VariadicOption

Undocumented in source.

Constructors

this
this(string flags, string description)
Undocumented in source.

Members

Aliases

Self
alias Self = typeof(this)
Undocumented in source.

Functions

_checkVal
void _checkVal(T value, T[] rest)
Undocumented in source. Be warned that the author may not have intended to support it.
_checkVal
void _checkVal(T[] values)
Undocumented in source. Be warned that the author may not have intended to support it.
_checkVal_impl
void _checkVal_impl(T value)
Undocumented in source. Be warned that the author may not have intended to support it.
choices
Self choices(T[] values)
Undocumented in source. Be warned that the author may not have intended to support it.
choices
Self choices(string[] values)
Undocumented in source. Be warned that the author may not have intended to support it.
choicesStr
string choicesStr()
Undocumented in source. Be warned that the author may not have intended to support it.
cliVal
Self cliVal(string value, string[] rest)
Undocumented in source. Be warned that the author may not have intended to support it.
configVal
Self configVal(T value, T[] rest)
Undocumented in source. Be warned that the author may not have intended to support it.
defaultVal
Self defaultVal(T value, T[] rest)
Undocumented in source. Be warned that the author may not have intended to support it.
defaultValStr
string defaultValStr()
Undocumented in source. Be warned that the author may not have intended to support it.
envVal
Self envVal()
Undocumented in source. Be warned that the author may not have intended to support it.
implyVal
Self implyVal(OptionVariant value)
Undocumented in source. Be warned that the author may not have intended to support it.
initialize
Self initialize()
Undocumented in source. Be warned that the author may not have intended to support it.
preset
Self preset(T value, T[] rest)
Undocumented in source. Be warned that the author may not have intended to support it.
preset
Self preset()
Undocumented in source. Be warned that the author may not have intended to support it.
presetStr
string presetStr()
Undocumented in source. Be warned that the author may not have intended to support it.
rangeOf
Self rangeOf(T min, T max)
Undocumented in source. Be warned that the author may not have intended to support it.
rangeOfStr
string rangeOfStr()
Undocumented in source. Be warned that the author may not have intended to support it.
typeStr
string typeStr()
Undocumented in source. Be warned that the author may not have intended to support it.

Properties

get
OptionVariant get [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
get
bool get [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
get
T[] get [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
get
T get [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.
isValid
bool isValid [@property getter]
Undocumented in source. Be warned that the author may not have intended to support it.

Variables

_max
T _max;
Undocumented in source.
_min
T _min;
Undocumented in source.
argChoices
T[] argChoices;
Undocumented in source.
cliArg
Nullable!(T[]) cliArg;
Undocumented in source.
configArg
Nullable!(T[]) configArg;
Undocumented in source.
defaultArg
Nullable!(T[]) defaultArg;
Undocumented in source.
envArg
Nullable!(T[]) envArg;
Undocumented in source.
innerValueData
T[] innerValueData;
Undocumented in source.
parseFn
ParseArgFn!T parseFn;
Undocumented in source.
presetArg
Nullable!(T[], bool) presetArg;
Undocumented in source.
processFn
ProcessArgFn!T processFn;
Undocumented in source.
processReduceFn
ProcessReduceFn!T processReduceFn;
Undocumented in source.

Inherited Members

From Option

_description
string _description;
Undocumented in source.
defaultValueDescription
string defaultValueDescription;
Undocumented in source.
mandatory
bool mandatory;
Undocumented in source.
flags
string flags;
Undocumented in source.
required
bool required;
Undocumented in source.
optional
bool optional;
Undocumented in source.
shortFlag
string shortFlag;
Undocumented in source.
longFlag
string longFlag;
Undocumented in source.
valueName
string valueName;
Undocumented in source.
variadic
bool variadic;
Undocumented in source.
hidden
bool hidden;
Undocumented in source.
conflictsWith
string[] conflictsWith;
Undocumented in source.
envKey
string envKey;
Undocumented in source.
implyMap
ImplyOptionMap implyMap;
Undocumented in source.
innerImplyData
OptionNullable innerImplyData;
Undocumented in source.
found
bool found;
Undocumented in source.
settled
bool settled;
Undocumented in source.
source
Source source;
Undocumented in source.
Self
alias Self = typeof(this)
Undocumented in source.
ImplyOptionMap
alias ImplyOptionMap = OptionVariant[string]
Undocumented in source.
isValueData
bool isValueData;
Undocumented in source.
innerBoolData
bool innerBoolData;
Undocumented in source.
_isMerge
bool _isMerge;
Undocumented in source.
description
string description()

get the description, and the output starts with description:

description
Self description(string desc)

set the description

matchFlag
bool matchFlag(Option other)

test whether the other Option variable's flag same in some parts

matchFlag
bool matchFlag(NegateOption other)

test whether the other NegateOption variable's flag same in some parts

conflicts
Self conflicts(string name)

specify the name of the option that conflicts with this option

conflicts
Self conflicts(string[] names)

specify the name of the options that conflicts with this option

implies
Self implies(string[] names)

imply the value of other options' value of true

implies
Self implies(string key, T value)

imply the value of other option's value of T, T must satisfy isOptionValueType

env
Self env(string name)

set the env variable's key so that the option can set its value from env

makeMandatory
Self makeMandatory(bool mandatory)

set whether the option is mandatory

hideHelp
Self hideHelp(bool hide)

set whether the option is hidden out of help command

name
string name [@property getter]

get the name

attrName
string attrName [@property getter]

get the attribute name with camel-like

envStr
string envStr [@property getter]

get the raw env variable in string type acccording to this.envKey which is set by this.env

isFlag
bool isFlag(string flag)

test whether a string is this option's long or short flag

isBoolean
bool isBoolean [@property getter]

test whether is a bool option

isOptional
bool isOptional [@property getter]

test whether is optional option

isRequired
bool isRequired [@property getter]

Test is required option

isMerge
bool isMerge()

Test is allowed to merge variadic final value from different source, default true

merge
Self merge(bool allow)

whether is allowed to merge variadic final value from different source, default true

implyVal
Self implyVal()

set the imply value as true, which is used for inernal impletation and is not recommended for use in you project

envVal
Self envVal()

set the option value from en

preset
Self preset()

set the preset value as true

cliVal
Self cliVal(string value, string[] rest)

set the value from client shell

isValid
bool isValid [@property getter]

test whether the argument is valid so that you can safely get the inner value after the return value is true

get
OptionVariant get [@property getter]

get the innner value and is recommended to be used after calling this.initialize()

initialize
Self initialize()

initialize the final value. if this.isValid is false, then would throw error

implyVal
Self implyVal(OptionVariant value)

set the imply value, which is used for inernal impletation and is not recommended for use in you project

choices
Self choices(T[] values)

set the choices of argument inner type

choices
Self choices(T value, T[] rest)
rangeOf
Self rangeOf(T min, T max)

set the range of option inner value when the option innner value type is int or double

defaultVal
Self defaultVal()

set the default value true, only for BooleanOption.

defaultVal
Self defaultVal(T value)

set the default value

defaultVal
Self defaultVal(T value, T[] rest)

set the default value

defaultVal
Self defaultVal(T[] values)

set the default value

configVal
Self configVal(T value)
Undocumented in source. Be warned that the author may not have intended to support it.
configVal
Self configVal(T value, T[] rest)
Undocumented in source. Be warned that the author may not have intended to support it.
configVal
Self configVal(T[] values)
Undocumented in source. Be warned that the author may not have intended to support it.
implyVal
Self implyVal(T value)
Undocumented in source. Be warned that the author may not have intended to support it.
implyVal
Self implyVal(T value, T[] rest)
Undocumented in source. Be warned that the author may not have intended to support it.
implyVal
Self implyVal(T[] values)
Undocumented in source. Be warned that the author may not have intended to support it.
preset
Self preset(T value)

preset the value used for value option

preset
Self preset(T value, T[] rest)

preset the value used for variadic option

preset
Self preset(T[] values)

preset the value used for variadic option

get
T get()

get inner value in the specified type, T usually is among OptionValueSeq

get
T get()

get inner value in the specified type, T usually is among OptionValueSeq

get
T get()

get inner value in the specified type, T usually is among OptionValueSeq

parser
Self parser()

set the parsing function using for transforming from string to T alias fn = T fn(string v), where T is the inner value type

processor
Self processor()

set the process function for processing the value parsed by innner parsing function alias fn = T fn(T v), where T is the inner value type

processReducer
Self processReducer()

set the reduce process function for reducely processing the value parsed by innner parsing function or process function mainly used in variadic option alias fn = T fn(T v, T t), where T is the inner value type

typeStr
string typeStr()

get the type in string type, used for help command and help option start with type:

defaultValStr
string defaultValStr()

get the default value in string type, start with default:

presetStr
string presetStr()

get the preset value in string type, start with preset:

envValStr
string envValStr()

get the env variable's key

implyOptStr
string implyOptStr()

get the imply map instring type, start with imply

conflictOptStr
string conflictOptStr()

get the list of confilt option in string type, start with conflict with

choicesStr
string choicesStr()

get the choices in string type, start with choices:

rangeOfStr
string rangeOfStr()

get the range in string type, start with range:

Meta