[systemd-devel] [PATCH] pager: remove --no-init setting from LESS options
Lennart Poettering
lennart at poettering.net
Tue Feb 11 11:17:49 PST 2014
On Tue, 11.02.14 20:05, Jason A. Donenfeld (Jason at zx2c4.com) wrote:
>
> On Tue, Feb 11, 2014 at 6:40 PM, Lennart Poettering
> <lennart at poettering.net> wrote:
> >
> > I think adding support for $SYSTEMD_LESS which is copied to $LESS right
> > before invoking less would be a good choice, since it would allow people
> > to override whatever systemd tries to set.
>
> So something along the lines of:
>
> user_less = getenv("SYSTEMD_LESS");
> if (!user_less) {
> if (scroll_to_end)
> final_less = "FRSXMK+G";
> else
> final_less = "FRSXMK";
> } else {
> if (scroll_to_end)
> final_less = concat(user_less, "+G");
> else
> final_less = user_less;
> }
Yupp. (THough I'd probably do the positive branch first, and the negative
one second, simply because it appears more "normalized" that way,
avoiding the explicit "!"... But that's just nitpicking, and it doesn't
matter....)
Lennart
--
Lennart Poettering, Red Hat
More information about the systemd-devel
mailing list