cmdline.option

The Option Type for Cmdline

This modlue mainly has Option Type. We can set the inner value by manly way. And if the Option value is valid, then we can initialize it and get the inner value.

Members

Aliases

OptionArrayValue
alias OptionArrayValue = AliasSeq!(string[], int[], double[])

a sequenece of inner option array type

OptionBaseValue
alias OptionBaseValue = AliasSeq!(string, int, double, bool)

a sequenece of inner option base type

OptionNullable
alias OptionNullable = Nullable!OptionValueSeq

a nullable variant which may contain one of type in OptionValueSeq

OptionValueSeq
alias OptionValueSeq = AliasSeq!(OptionBaseValue, OptionArrayValue)

a sequenece of inner option type, equals to the union of OptionBaseValue and OptionArrayValue

OptionVariant
alias OptionVariant = Variant!OptionValueSeq

a no-nullable variant which may contain one of type in OptionValueSeq

ParseArgFn
alias ParseArgFn(Target) = Target function(string str)

the callback for parsing the string value to the target type

ProcessArgFn
alias ProcessArgFn(Target) = Target function(Target value)

furhter callback after using ParseArgFn

ProcessReduceFn
alias ProcessReduceFn(Target) = Target function(Target cur, Target prev)

the callback for recursingly parsing the multiple values to only one value with same type, using in VariadicOption

Classes

BoolOption
class BoolOption
Undocumented in source.
NegateOption
class NegateOption

the negate option like --no-flag, which is controller option that doesn't contains inner value.

Option
class Option

the option type. store the value that command line's options input. we can get the inner value after it is initialized.

ValueOption
class ValueOption(T)
Undocumented in source.
VariadicOption
class VariadicOption(T)
Undocumented in source.

Enums

Source
enum Source

the source of the final option value gotten

Functions

_camelCase
string _camelCase(string str)
Undocumented in source. Be warned that the author may not have intended to support it.
createNOption
NegateOption createNOption(string flags, string desc)
Undocumented in source. Be warned that the author may not have intended to support it.
createNegateOption
NegateOption createNegateOption(string flags, string desc)

creae a negate option

createOption
Option createOption(string flags, string desc)

create bool option

createOption
Option createOption(string flags, string desc)

create bool option

createOption
Option createOption(string flags, string desc)

create value/variadic option, whose inner type or inner value's element type T must satisfy isBaseOptionValueType and not bool

createOption
Option createOption(string flags, string desc)

create varidic option, whose inner values's element type T must satisfy isBaseOptionValueType and not bool

splitOptionFlags
OptionFlags splitOptionFlags(string flags)
Undocumented in source. Be warned that the author may not have intended to support it.
testType
bool testType(OptionNullable value)
Undocumented in source. Be warned that the author may not have intended to support it.

Structs

OptionFlags
struct OptionFlags
Undocumented in source.

Templates

isBaseOptionValueType
template isBaseOptionValueType(T)

a trait func for checking whether a type is base inner option value (OptionBaseValue)

isOptionValueType
template isOptionValueType(T)

a trait func for checking whether a type is option inner value (OptionValueSeq)

Meta

Authors

笑愚(xiaoyu)