check whether a type is the struct that can be the container to store the parsed value from command line.
construct the command line program without action callback
get the pointer to result container of parent.
get the pointer to result container of parent.
parse the command line option and argument parameters according to the given command conatiner type. T = the command conatiner type
detect whether a sub command's container of a main command is ready for use. for using this function, the BEGIN and END mixin-macro must be embeed in main command container. T is the type in sub-command container, U is the type in main-command container
parse the command line option and argument parameters according to the given command conatiner type. And invoke the action member function and return if exists, otherwise invoke member container's action member function recursely. T = the root command container type
get a pointer to sub-command container. T is the type in sub-command container, U is the type in main-command container
set an alias
prepare for the future use of function ready and getParent, which must be embedded at the top of struct domain with END mixin-marco at the end of this struct domain.
set the choices list to a registered option or argument
enable gaining value from config file in json and set an option that specifies the directories where the config file should be
the basic version of both DEF_ARG and DEF_OPT
set the default value to a registered option or argument
set the default sub-command which would act like the main-command except help, version and config options and sub-command if exists.
use for defining a command line argument
use for defining a command line option
Add description to a registered option or argument.
set description
Add description to a registered argument.
Add description to a registered option.
disable the help sub-command and action-option
disable the merge feature of a registered variadic option
<br><br> disable the feature that variadic options under the command can merge value from various source
disallow the feature that can combine flags
disallow the excess arguments
prepare for the future use of function ready and getParent, which must be embedded at the end of struct domain with BEGIN mixin-marco at the begin of this struct domain.
set the env key from which get the values to a registered option
apply Command.exportAs to the command line container
apply Command.exportNAs to the command line container
add custom help text after command help text
add custom help text before command help text
hide a registered option from help sub-command and action-option
<br><br> hide the command from help sub-command and action-option, usually used on sub-command
set a negate option for a registered option, and its long flag is --no-NAME_OF_OPTION
don't show suggestions after parsing error
set the options acting as arguments on command line
allow the command to pass through its option flag behind sub command
set the preset value to a registered option
set the range of a registered option or argument which inner type is numeric type
show help after parsing error
set sub commands
set the version string and enable the version sub-command and action-option
the field of command container which is used to register a argument on the command. the name of it is the name of this argument. can implicitly convert to bool value same as the result of ArgVal.isValid. T is the innerType of the argument, isOptional true to set it optional, default is false.
used inside the bracket of DEF, DEF_ARG and DEF_OPT to set the choices of an option or an argument
used inside the bracket of DEF, DEF_ARG and DEF_OPT to set the default value of an option or an argument
used inside the bracket of DEF, DEF_ARG and DEF_OPT to set the desc of an option or an argument
used inside the bracket of DEF, DEF_OPT to disable the merge feature of variadic option
used inside the bracket of DEF, DEF_OPT to set the value from environment of an option
used inside the bracket of DEF, DEF_OPT, see EXPORT
used inside the bracket of DEF to set the flag of an option
used inside the bracket of DEF, DEF_OPT to hide an option from help info
used inside the bracket of DEF, DEF_OPT, see EXPORT_N
used inside the bracket of DEF, DEF_OPT to set the negate option of an option
the field of command container which is used to register a option on the command. the name of it is the name of this option. can implicitly convert to bool value same as the result of ArgVal.isValid. T is the innerType of the option or the elemental type of innerType isMandatory true to set it mandatory, default is false, shortAndVal the short flag and value flag(if needed) seperated by space, comma and |
used inside the bracket of DEF to set the option mandatory or set the argument optional
used inside the bracket of DEF, DEF_OPT to set the preset value of an option
used inside the bracket of DEF, DEF_ARG and DEF_OPT to set the range of an option or an argument
used inside the bracket of DEF, DEF_OPT to make an option act like an argument
The extenstion module for Cmdline
This module give a new programming way to build the command line prgram. And it is publicly imported into main modlue cmdline.
Using the following mixin-macro which are used for being embedded in a struct whose name is end with Result and fields must be among ArgVal, OptVal and the pointer to other structs that are satisfied with and the two function coustruct and parse, you can build and parse the command line argument and option parameters. And Also, We can get the parsed value from command line more easily.