Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: PIPE less

by Crackers2 (Parson)
on Apr 16, 2010 at 14:14 UTC ( #835100=note: print w/replies, xml ) Need Help??

in reply to PIPE less

I'd say don't do this.

If your user wants to view the help in less, it's easy enough for them to pipe your script to less themselves. With an implicit less you also make it harder to just dump out the whole help.

Replies are listed 'Best First'.
Re^2: PIPE less
by FunkyMonk (Canon) on Apr 16, 2010 at 15:51 UTC
    My less (version 436 by Mark Nudelman) doesn't page unless its STDOUT is connected to a terminal

      For the reason outlined by BrowserUK below, I often like to just dump the help to stdout so I can use (in most terminals) Shift-PgUp and Shift-PgDown to look through it while actually typing the command.

      Of course that's still possible either way. Doing something like "program --help | cat" could probably trick less into thinking it's not connected to a terminal.

Re^2: PIPE less
by choroba (Bishop) on Apr 16, 2010 at 14:19 UTC
    Which leads back to my answer, Re: PIPE less, giving the user more options (usually usage, help and man).

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://835100]
[james28909]: how come it is so easy for me to not care what others think while others will mute themselves because they are scare they will be called ignorant or stupid
[james28909]: do you relize how shrodinger felt when he was describing the quantum world? what about neils bohr?
[holli]: it's probably the autist in you. I am like that too, no fucks given about what others think about me
james28909 checks, yep... htere are no fucks to give

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2017-12-15 14:23 GMT
Find Nodes?
    Voting Booth?
    What programming language do you hate the most?

    Results (433 votes). Check out past polls.