-
Notifications
You must be signed in to change notification settings - Fork 4
Description
The command line parser should be able to generate help pages from the a declared parser and command line arguments. The help page should adapt to the command that the help was requested for. For example test --help command should produce the general help page for test, while test command --help should generate the help page for the command. If there are multiple help flags such as in test --help command -h, then the most specific help page should be generated, i.e. in this case the help page for the command should be generated. The name and alias of the help switch should be configurable, but should default to --help and -h.
The API should look something like this:
// Uses --help and -h as default for the flag that is used to determine which help page is to be generated
parser.GenerateHelpPage(commandLineArguments);
// But they can be explicitly be defined by the user
parser.GenerateHelpPage(commandLineArguments, "help", "h");The format for the help pages should be similar to most help pages generated by programs today. There should be a line showing the usage, then a description should follow, then all positional, named, and flag arguments should be documented, and finally a list of commands should be displayed. A project which has nice help pages is docopt. The .NET Core CLI also produces nice help pages and can be used as a reference.