[PATCH] man: use less as default pager and parse DEFINE lines defining pager

John Spencer maillist-busybox at barfooze.de
Sun Jun 2 12:01:01 UTC 2013


On 06/02/2013 01:48 PM, Tito wrote:
> On Sunday 02 June 2013 12:51:21 John Spencer wrote:
>> man.config can define lines such as
>> DEFINE         pager   less -s
>>
>> this patch parses them, additionally it always sets pager to less
>> instead of more.
>>
>> Signed-off-by: John Spencer<maillist-busybox at barfooze.de>
>>
>>
>
>
> +               /* environment overrides setting from man.config */
> +               const char* env_pager = getenv("MANPAGER");
> +               if (!env_pager) env_pager = getenv("PAGER");
> +               if (env_pager) pager = env_pager;
> +               if (!pager) pager = "less";
>
> Hi,

hi,

> what if there is no less on the system?
> Maybe we should check at config time that at least one
> of the pagers (more, less) is enabled an use that as default
> and eventually if both are enabled prefer less.

1) more should always just be a simple wrapper around less
2) it's possible to build busybox without less and more, and use the 
"real less" package from elsewhere - just because busybox' less is not 
built does not guarantee it's missing.
3) in case both more and less are missing, the sysadmin can now DEFINE 
the pager via /etc/man.config

>
> Just my 2 cents.
>
> Ciao,
> Tito
>
> _______________________________________________
> busybox mailing list
> busybox at busybox.net
> http://lists.busybox.net/mailman/listinfo/busybox
>



More information about the busybox mailing list