For example: if I enter the cp command with a wrong switch, it displays how to show the help:
$ cp -y
cp: invalid option -- 'y'
Try 'cp --help' for more information.
If you don't want to hard code this, one option would be to give the programmer the ability to specifies an 'unknown option handler'.
For example: if I enter the
cpcommand with a wrong switch, it displays how to show the help:If you don't want to hard code this, one option would be to give the programmer the ability to specifies an 'unknown option handler'.