3 ms·
Don't forget `-h` "chastise me for not using --help, and don't show the help". and `-h` print "usage: $program [TBhrRtzFwbvjEBUQ]" This is assuming all the co
by jodrellblank 6y ago
Don't forget `-h` "chastise me for not using --help, and don't show the help".
and `-h` print "usage: $program [TBhrRtzFwbvjEBUQ]"
This is assuming all the commands are in one binary, and you know what the binary is (compare 'yum install' and 'yum search' with 'apt-get install' vs 'apt-cache search').
> Most CLI tools implement these
Most? You can see there's a big competing pattern of having multiple binaries with the same prefix like ssh ssh-agent ssh-keygen, dbus-FOO dpkg-FOO apt-FOO snmpFOO ldapFOO.
And there are plenty which don't have this "clearly delineated sub-command" like git has.
> where [GUI] has almost no de-facto standards like this
The massive main de-facto standard a GUI has is showing you important things up front and hiding irrelevant and uncommon things away. With a CLI you see nothing until you --help then you see everything. There's no indication of what's a common path through the tool.
openssl sha --help shows "-non-fips-allow" above "-sha1".
It's not showing options in alphabetical order. Am I to infer that "-sigopt nm:v" is more common, more used, more important, than "use SHA1" because it's higher up in the list? If not, why is it higher up in the list?
Hamburger menu? Right-click on a thing to show you a context menu of things you can do with a thing? A central content area with "tabbed sections" along the top (real tabs or links like a menu bar)? Mouse hover-and-pause tooltip? "select an item and press F1 for help"? Have a username link or avatar picture behind which your user-specific options are? Are these not large and common "de-facto standards" in GUIs?
- kmstout 6y ago> You can see there's a big competing pattern of having multiple binaries with the same prefix One could create an entire ecology of tools that operates as a sort of compromise: Have a family of separate programs named with a common prefix (e.g., foo-), and a dispatch program (foo) that, when run like foo bar options dispatches to foo-bar with the options, and when run like foo [-h|--help] prints a help message and then lists every foo- program on the PATH, incorporating the whatis output where available. (That last bit requires man pages to work, but you can't very well tell people to read a manual that doesn't exist.) I have used this strategy at work with considerable success.
- thewakalix 6y agoI believe Cargo (of the Rust ecosystem) works this way. One benefit is that it can be extended by the community (for example, cargo-update).