3 ms·
I hate --help. First, I hate having to run the program. If I wanted to refresh myself on the shutdown command, running “shutdown --help” would make me extremel
by bentley 2y ago
I hate --help.
First, I hate having to run the program. If I wanted to refresh myself on the shutdown command, running “shutdown --help” would make me extremely nervous!
There have been times where I’ve only had source code and wanted to read the documentation before taking the time to compile it or install dependencies or whatever. With a manpage I can just pipe it through mandoc.
Sometimes --help output is short, sometimes it’s 150 lines long and scrolls off my screen. So I hit up, end, |less, and I get nothing, because in some programs it goes to stderr instead of stdout. So I hit up, end, ^W, 2>&1 |less. Ugh.
And --help is not even close to a universal convention. In some programs --help will open HTML documentation in a browser (really!?). Often programs don’t print help at all, instead printing a generic “bad flag” error. Some will create a file named --help without asking! Some programs don’t use long options and relegate it to -h, or -?.
Manpages are a much more universal convention, thanks to Debian’s policy that all packaged programs have manuals. I don’t even use Debian, but I encounter manuals attributed to them all the time. I do my part by writing manpages for my own software and sometimes contributing new manpages to programs I encounter that don’t have one.
- mmphosis 2y agoI agree. I just ran "shutdown -h" and it turned off my computer. I need to look into creating man pages again. Command 'mandoc' not found, but can be installed with: apt install mandoc A universal convention would be nice. That whole stdout vs stderr business. openbsd-cut -badoption | less I didn't even consider -?. And -h can mean --how-many-different-things: Host, --human-readable, --poweroff (as I just discovered), open HTML documentation in a browser (just wow), and maybe Help, maybe not enough help, maybe too much help, maybe...
- sgarland 2y agoFor small programs with limited flags, I like (and write them this way) having `--help` simply list the expected syntax, and a brief description of the short and long flags. If I need a pager to read it, it's too long for `--help`.