|
| 1 | +# ...HelpInfo |
| 2 | + |
| 3 | +There are few structs that describe help information for argument parsing entities. |
| 4 | + |
| 5 | +## ArgumentHelpInfo |
| 6 | + |
| 7 | +`ArgumentHelpInfo` contains data that is needed to print help for an command line argument: |
| 8 | + |
| 9 | +- `const string[] names` - all short and long names of an argument prefixed with `Config.shortNamePrefix` or |
| 10 | + `Config.shortNamePrefix` respectively. |
| 11 | +- `string description` - description of an argument. |
| 12 | +- `string placeholder` - value placeholder (eg. `VALUE` for `--foo VALUE` argument). |
| 13 | +- `bool multipleOccurrence` - flag denoting that an argument can appear multiple times in command line. |
| 14 | +- `bool optionalValue` - flag denoting that the value is optional for argument. |
| 15 | +- `bool optionalArgument` - flag denoting that an argument itself is optional. |
| 16 | +- `bool positional` - flag denoting that an argument is positional (otherwise, it's named argument). |
| 17 | +- `bool hidden` - flag denoting that an argument should be hidden from help screen. |
| 18 | +- `bool booleanFlag` - flag denoting that an argument is a boolean flag. |
| 19 | + |
| 20 | +## ArgumentGroupHelpInfo |
| 21 | + |
| 22 | +`ArgumentGroupHelpInfo` contains information about arguments group: |
| 23 | + |
| 24 | +- `string name` - name of the group. |
| 25 | +- `string description` - group description. |
| 26 | +- `const size_t[] argIndex` - indexes of arguments that belong to this group. Arguments themselves are store in [`CommandHelpInfo`](#commandhelpinfo). |
| 27 | + |
| 28 | +## SubCommandHelpInfo |
| 29 | + |
| 30 | +`SubCommandHelpInfo` contains information about subcommand: |
| 31 | + |
| 32 | +- `const string[] names` - subcommand names. |
| 33 | +- `string description` - subcommand description. |
| 34 | + |
| 35 | +## CommandHelpInfo |
| 36 | + |
| 37 | +`CommandHelpInfo` contains information about subcommand: |
| 38 | + |
| 39 | +- `string name` - command name. |
| 40 | +- `string usage` - command usage. |
| 41 | +- `string description` - command description. |
| 42 | +- `string epilog` - command epilog. |
| 43 | +- `ArgumentHelpInfo[] arguments` - all arguments of the command. |
| 44 | +- `ArgumentGroupHelpInfo requiredGroup` - group of required arguments of the command. |
| 45 | +- `ArgumentGroupHelpInfo optionalGroup` - group of optional arguments of the command. |
| 46 | +- `ArgumentGroupHelpInfo[] userGroups` - user-defined groups of arguments of the command. |
| 47 | +- `SubCommandHelpInfo[] subCommands` - subcommands. |
| 48 | + |
| 49 | +This struct also has the following helpers to iterate over positional or named arguments only - the both return filtered |
| 50 | +range of arguments (`ArgumentHelpInfo` objects): |
| 51 | + |
| 52 | +- `auto positionalArguments() const` |
| 53 | +- `auto namedArguments() const` |
0 commit comments