There isn't a correct way. But there isn't on Unix, either. The --help
convention is in fact a GNU convention. It's widespread on Linux distributions, where the operating system utilities are GNU ones. But you won't see it in the operating system utilities on a BSD, for example:
$ /bin/sh --help
Illegal option --
$ nawk --help
nawk: no program given
$
Much as the --help
convention has been seen by many as a good idea, and adopted; the /?
convention (which originated in DR-DOS 5.0 as a /H
convention) has been seen by many as a good idea, and adopted. You'll find that many commands support it. But equally as not all commands in Unix or Linux support --help
not all commands in DOS or Windows NT support /?
.
You might think that man
comes to the rescue here. Thanks to GNU info
, and the fact that several program maintainers seem to place information (even sometimes information as basic as what the command-line options are) only in the info
page and not in the man
page or vice versa, it's not the panacaea that it might be thought to be, however.
man
doesn't really have an equivalent in the DOS and Windows NT world. The closest equivalent was help
command, which in DR-DOS 5.0 and later and MS-DOS 6.0 and later would look up command in a database of help pages and display the page. The problem here is that whilst all of the operating system's own housekeeping utilities had pages in this database, almost no-one else's programs did, and the system was hard to add third-party information to.
(DOSBook, introduced in DR-DOS 6.0 was about the best that any commercial DOS got with this. MS-DOS used QuickHelp files, the tool for compiling which wasn't supplied with the base operating system. PC-DOS 7 had the IPF system, a tool for compiling which again was lacking from the operating system. OS/2 had the same IPF system as PC-DOS, and a HELP command that was integrated with it, although again the compiler, IPFC, was in the Developers Toolkit rather than in the box with the operating system. Many years ago I wrote an improvement upon the supplied HELP command where one could configure which command references it looked commands up in by default, with an environment variable. I also provided an extended command reference book for some commands that I'd written.)
Windows NT still has help
command to this day. It's a step backwards from what MS-DOS 6 had, let alone from what DR-DOS, PC-DOS, and OS/2 had.
So the actual answer is: You're supposed to trawl through MSDN, or read someone else's WWW site, or read a book, or read the source code (if it's open source), or just know telepathically …
That said, documentation on the WWW is not a bad thing, and is largely the expectation nowadays. (Although one can miss things like IPFC building indexes and tables of contents for one. ☺) Microsoft documents a whole raft of command-line commands on TechNet and in MSDN, as you have seen.
Further reading