Hacker News new | past | comments | ask | show | jobs | submit login

At least good CLI programs have a help command that spells out exactly what they do. Or even a man page.



Yes 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.


I 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"`).


You 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.)


> 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.


To print, one used to pipe things into the lpr command, discoverable using the apropos command.


    $ 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.


Here's zsh on my machine: http://imgur.com/dZshfUR


This switch lacks documentation




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: