The type of parse parameter
Optional
Readonly
appendAllows appending elements if supplied multiple times.
Optional
Readonly
breakTrue to break the parsing loop after parsing the option.
Optional
Readonly
choicesThe allowed parameter values.
Optional
Readonly
clusterThe letters used for clustering in short-option style (e.g., 'fF').
Letters are subject to the same restrictions as OptionAttributes.names.
Optional
Readonly
clusterThe prefix of cluster arguments. If set, then eligible arguments that have this prefix will be considered a cluster. Has precedence over OptionAttributes.optionPrefix.
Optional
Readonly
completeA custom callback for word completion.
Optional
Readonly
defaultTe default value or a callback that returns the default value.
The default value is set at the end of the parsing loop if the option was not supplied. You may use a callback to inspect parsed values and determine the default value based on those values.
Optional
Readonly
deprecatedThe option deprecation notice.
Optional
Readonly
exampleThe example value to display in the parameter column or in usage statements.
Optional
Readonly
groupThe option group in the help message.
Use the value null
to hide it from the help message.
Optional
Readonly
inlineWhether inline parameters should be disallowed or required for this option.
Can be false
to disallow or 'always'
to always require.
It can also be a record that maps option names to one of the above, indicating whether the corresponding name disallows or requires inline parameters.
Optional
Readonly
layoutThe option-specific layout settings.
Optional
Readonly
limitThe maximum allowed number of elements.
Optional
Readonly
linkA hyperlink to an external resource.
Optional
Readonly
mappingA record that maps parameter values to option values.
Optional
Readonly
markerThe marker(s) to delimit option parameters. If set, then all arguments appearing after/within the marker(s) will pertain to this option. It is subject to the same restrictions as OptionAttributes.names.
Optional
Readonly
namesThe option names, as they appear on the command-line (e.g. -h
or --help
).
Names cannot contain the equals sign =
, since it may be used as option-parameter separator.
null
s can be specified in order to skip the respective "slot" in the help message names column.
Optional
Readonly
normalizeA normalization function applied to parameters before they get validated and/or parsed.
Optional
Readonly
optionThe prefix of option names. If set, then arguments that have this prefix will always be considered an option name.
Optional
Readonly
optionsThe subcommand's options. It can also be a module path or a callback that returns the options.
Optional
Readonly
paramThe function's parameter count:
Infinity
, the option accepts unlimited parameters.min
and max
parameters.Optional
Readonly
paramThe parameter name to display in the parameter column or in usage statements. Overrides OptionAttributes.example in usage statements.
Optional
Readonly
parseA custom callback for parsing the option parameter(s).
Optional
Readonly
positionalWhether the option accepts positional arguments.
If there are multiple positional options, their declaration order determines their relative position in the command line. A variadic option will take all remaining positional arguments. Otherwise, if there are more arguments than options, the last such option will take the excess.
We recommend also setting OptionAttributes.preferredName to some explanatory name.
Optional
preferredA name to be displayed in error and help messages in cases where one is not available (e.g., when evaluating option requirements or processing positional arguments). It is not validated and can be anything.
If not specified, the first name in the OptionAttributes.names array will be used.
Optional
Readonly
regexThe regular expression that parameters should match.
Optional
Readonly
requiredTrue if the option is always required.
Optional
Readonly
requiredThe conditional requirements.
Optional
Readonly
requiresThe forward requirements.
Optional
Readonly
saveWhether to save the message in the option value instead of throwing it.
Optional
Readonly
sectionsThe help sections to be rendered.
Optional
Readonly
separatorThe parameter value separator.
Optional
skipThe number of remaining arguments to skip. It is meant to be changed by the callback. (The parser does not alter this value.)
Optional
Readonly
sourcesThe names of data sources to try reading from (in that order), if the option was not supplied
on the command line. A string
means an environment variable, while a URL
means a local file.
Environment variable names are subject to the same restrictions as OptionAttributes.names.
Has precedence over OptionAttributes.stdin.
Optional
Readonly
stdinTrue to read data from the standard input, if the option was not supplied.
Warning: this may block the application if OptionAttributes.required is set and the terminal is interactive.
Optional
Readonly
stylesThe option display styles.
Optional
Readonly
synopsisThe option synopsis.
Optional
Readonly
uniqueTrue if duplicate elements should be removed.
Optional
Readonly
usageThe parameter name to display in usage statements. Overrides OptionAttributes.example and OptionAttributes.paramName in usage statements.
Optional
Readonly
useWhether to use the next argument as the name of a subcommand. Has precedence over OptionAttributes.useFilter.
Optional
Readonly
useWhether to use the remaining arguments as option filter.
Optional
Readonly
versionThe version information (e.g., a semantic version).
Defines all option attributes.