On Fri, Apr 29, 2016 at 2:33 AM, Steven D'Aprano <st...@pearwood.info> wrote:
> I have an application written in Python which accepts -h or --help to show
> help. I can:
>
> (1) print the help text to stdout;
>
> (2) run the help text through a pager;
>
> (3) do something else?
>
>
> Many command line tools simply output help to stdout (or stderr, if they're
> evil),

I'm not sure stderr is particularly more evil than stdout, but whatever :)

What you could do is run the help text through a pager only if stdout
is a TTY. That allows it to be grepped conveniently, but also browsed
easily. But I wouldn't worry about that unless you have at least 3-5
pages of screed - for most programs, just dumping the text to a
standard stream is usually enough.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to