3 ms·
> should have an -explain suffix Adding -h or --help generally does something useful
by nonrandomstring 4y ago
> should have an -explain suffix
Adding -h or --help generally does something useful
- bottlepalm 4y agoThat gives you a list of all the commands, no something short and sweet about exactly what the command you have written will do. If --explain is part of the argument parser then it would be relatively easy to implement.
- nonrandomstring 4y agoSome programs kinda do that, but you're hitting on an old problem that Unix/Linux has a few ways of doing similar things all of which can miss the mark. commands info, man and apropos are fairly close to your goal, but: - info only covers bash/core-utils - not everything installs something into the apropos file (and many package managers seem awful at remembering to delete entries on uninstall) - man pages have many standards and good practices, but some are still terrible or nonexistent So a --help switch is the lowest common denominator. And has the advantage of living in the executable as an argument parsing outcome. But that means it suffers locale parochialism. I think people may be afraid adding yet another switch like --explain would only make things messier. So far I think the best is usually the first stanza of a well written man page.