3 ms·
At least good CLI programs have a help command that spells out exactly what they do. Or even a man page.
by hayksaakian 11y ago
At least good CLI programs have a help command that spells out exactly what they do. Or even a man page.
- m_mueller 11y agoYes that's mostly enough for simple cases, but have you ever tried to discern a gcc command with 12 compilation flags enabled? It takes you half an hour to find everything you need in the man pages. 30 years after the wide scale spread of pointer devices this is IMO just ridiculous.
- tatterdemalion 11y agoI wouldn't try to justify the awfully huge number of commands that many unix util implementations have - which seems like an anti-unix design movement to me - but you can at least cut down the 30 minutes of man page spelunking with man <foo> | grep -A 3 "\<flag>". Adjust -A argument as needed. (for example, if you don't know what -A does on grep, run `man grep | grep -A 3 "\-A"`).
- Qantourisc 11y agoYou can also use / in man to do a search in man. (Assuming your pager supports it, don't forget to use the home key to go back to the beginning for a new search option.)
- wz1000 11y agoHere's zsh on my machine: http://imgur.com/dZshfUR http://imgur.com/dZshfUR
- hayksaakian 11y agoThis switch lacks documentation
- vacri 11y ago> have you ever tried to discern a gcc command with 12 compilation flags enabled? This isn't a 'discoverability' problem - the problem is the complex task. Most of what you're doing on the commandline isn't "gcc with 12 compilation flags". "How do I print this document?" is an example of poor discoverability on the CLI; command flags are not.
- nitrogen 11y agoTo print, one used to pipe things into the lpr command, discoverable using the apropos command.
- vacri 11y ago$ apropros print bash: apropros: command not found $ man print | head -n 1 RUN-MAILCAP(1) Run Mailcap Programs RUN-MAILCAP(1) $ man -k print | wc -l # lp/lpr is in this list... but you have to find them in a list of 200. 196 $ man printer No manual entry for printer It's not great discoverability. 'man -k printer' is the best I found so far to find lpr, but it took a few goes to find it.