Updated: October 28, 2024 |
QNX Neutrino lets an executable have a built-in usage message, a short reminder of the command-line options and some notes on what the executable does.
You can try this out right now at a command-line—type use cat to get information about the cat command. You'll see the following:
cat - concatenate and print files (POSIX) cat [-cu] [file...] Options: -c Compress, do not display empty lines. -u Unbuffered, for interactive use. -n Print line numbers without restarting. -r Print line numbers restarting count for each file.
You can add these messages into your own executables. My standard mkmain script generates the Makefile and main.use files required for this.
/* #ifdef __USAGE %C A utility that's using a single quote #endif */
It's an ANSI C compiler thing. :-)