I recently gave a workshop on Linux tools and have been telling students to consult the man pages of commands should they run into errors. However, I noticed that the command itself never returns a message to see the man page with the man command. Most commands advise to use the --help option, use the info page, a blurb on the usage or just print the error message. I am wondering why does no command ask the user to consult the man page? Wouldn't that be the first place to go looking when it is being used incorrectly?
Why does no command advise the user to consult a man page on incorrect usage?
command line;man
There is an objective reason for this.--help is a flag built in to the utility itselfbuilt into the binary executable, or if it's a script then built into the script.Man pages are stored separately on the filesystem from the executable itself.Man pages can be missing and the executable itself still accessible.As a utility developer, pointing users to a documentation resource which may or may not be present on their system makes less sense than inlining the information in the code itself.Not only that, but the version of the executable and the version of the man page may or may not line up.I have encountered this, for instance, when a version of Postgres was shipped with a certain package, and a different version of Postgres was also installed on the system.  man psql would show information for one version, but it wasn't the version you actually got by running psql.  If there were no --help flag, I would have had a big mystery why certain options didn't work according to the man page.