- _checkConfilctOption
void _checkConfilctOption()
Undocumented in source. Be warned that the author may not have intended to support it.
- _checkMissingMandatoryOption
void _checkMissingMandatoryOption()
Undocumented in source. Be warned that the author may not have intended to support it.
- _exit
void _exit(ubyte exitCode)
Undocumented in source. Be warned that the author may not have intended to support it.
- _exitErr
void _exitErr(string msg, string code)
Undocumented in source. Be warned that the author may not have intended to support it.
- _exitSuccessfully
void _exitSuccessfully()
Undocumented in source. Be warned that the author may not have intended to support it.
- _findArgument
inout(Argument) _findArgument(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- _findCommand
inout(Command) _findCommand(string name)
Undocumented in source. Be warned that the author may not have intended to support it.
- _findNegateOption
inout(NegateOption) _findNegateOption(string flag)
Undocumented in source. Be warned that the author may not have intended to support it.
- _findOption
inout(Option) _findOption(string flag)
Undocumented in source. Be warned that the author may not have intended to support it.
- _getCommandAndAncestors
inout(Command)[] _getCommandAndAncestors()
Undocumented in source. Be warned that the author may not have intended to support it.
- _getHelpCommand
Command _getHelpCommand()
Undocumented in source. Be warned that the author may not have intended to support it.
- _getHelpOption
Option _getHelpOption()
Undocumented in source. Be warned that the author may not have intended to support it.
- _helpCommandAction
void _helpCommandAction(OptsWrap _, ArgWrap hcommand)
Undocumented in source. Be warned that the author may not have intended to support it.
- _optionImpl
Self _optionImpl(string flags, string desc)
Undocumented in source. Be warned that the author may not have intended to support it.
- _optionImpl
Self _optionImpl(string flags, string desc)
Undocumented in source. Be warned that the author may not have intended to support it.
- _optionImpl
Self _optionImpl(string flags, string desc, T defaultValue)
Undocumented in source. Be warned that the author may not have intended to support it.
- _outputHelpIfRequested
void _outputHelpIfRequested(string[] flags)
Undocumented in source. Be warned that the author may not have intended to support it.
- _parseCommand
void _parseCommand(string[] unknowns)
Undocumented in source. Be warned that the author may not have intended to support it.
- _prepareUserArgs
string[] _prepareUserArgs(string[] args)
Undocumented in source. Be warned that the author may not have intended to support it.
- _processConfigFile
const(JSONValue)*[] _processConfigFile()
Undocumented in source. Be warned that the author may not have intended to support it.
- _registerArgument
void _registerArgument(Argument arg)
Undocumented in source. Be warned that the author may not have intended to support it.
- _registerCommand
void _registerCommand(Command command)
Undocumented in source. Be warned that the author may not have intended to support it.
- _registerOption
void _registerOption(Option option)
Undocumented in source. Be warned that the author may not have intended to support it.
- _registerOption
void _registerOption(NegateOption option)
Undocumented in source. Be warned that the author may not have intended to support it.
- addActionOption
Self addActionOption(Option option, void delegate(string[] vals...) call_back, bool endMode)
add the action option to command, which will invoke the callback we injected when parsing the flag of this option, only useful in client cmd
- addArgument
Self addArgument(Argument argument)
- addCommand
Self addCommand(Command cmd, bool[string] cmdOpts)
add the sub command, which is often used when you want more detail configuration of sub command
- addHelpCommand
Self addHelpCommand(string flags, string desc)
- addHelpCommand
Self addHelpCommand(Command cmd)
- addHelpOption
Self addHelpOption(string flags, string desc)
- addHelpOption
Self addHelpOption(Option option, void delegate() action)
- addHelpText
Self addHelpText(AddHelpPos pos, string text)
add a appendent help text at specified position
- addOption
Self addOption(Option option)
add the option to command
- addOption
Self addOption(NegateOption option)
add the negate option to command
- addVersionCommand
Self addVersionCommand(Command cmd)
set version command, see also Self setVersion(string str, string flags = "", string desc = "")
- addVersionCommand
Self addVersionCommand(string flags, string desc)
set version command, see also Self setVersion(string str, string flags = "", string desc = "")
- addVersionOption
Self addVersionOption(Option opt, void delegate() action)
custom the version option
- addVersionOption
Self addVersionOption(string flags, string desc)
set the version option of the command, see also Self setVersion(string str, string flags = "", string desc = "")
- aliasName
string aliasName()
get the first alias of command
- aliasName
Self aliasName(string aliasStr)
- aliasNames
const(string[]) aliasNames()
get the sequence of aliases of command
- aliasNames
Self aliasNames(string[] aliasStrs)
set a sequence of aliases of command
- allowExcessArguments
Self allowExcessArguments(bool allow)
whether allow excess argument, default: true
- allowExposeOptionValue
Self allowExposeOptionValue(bool allow)
whether allow expose options' values to its sub commands, default: false
- allowVariadicMerge
Self allowVariadicMerge(bool allow)
whether allow variadic options' final values merge from different source, default: true
- argToOpt
Self argToOpt(string optName, string[] rest)
register an option that can be as the argument of command line.
remember that it is positional sensitive and if you want to registered a variadic
option, this option must be registered at the end and not other variadic options to be registered
- argument
Self argument(string name, string desc, T defaultVal)
define the argument with default value for command, used for variadic argument
- argument
Self argument(string name, string desc, T val, T[] rest)
define the argument with default value for command, used for variadic argument
- argument
Self argument(string name, string desc, T val)
define the argument with default value for command, used for no-variadic argument
- argument
Self argument(string name, string desc)
define the argument for command
- argumentDesc
Self argumentDesc(string argName, string desc)
define the arguments' descriptions
- argumentDesc
Self argumentDesc(string[string] descMap)
define the arguments' descriptions
- arguments
Self arguments(string names)
define manly arguments for command
- comineFlagAndOptionValue
Self comineFlagAndOptionValue(bool combine)
whether allow combine flag mode like ls -al, default: true
- command
Command command(string nameAndArgs, bool[string] cmdOpts)
define a sub command and sub command's arguments,
this sub command inherit the basic configuration of parent command
- command
Self command(string name, string desc, string[string] execOpts)
define a sub command, which represents the external command line program
- configureHelp
Self configureHelp(Help helpConfig)
- configureHelp
inout(Help) configureHelp()
get the help configuration
- configureOutput
inout(OutputConfiguration) configureOutput()
get the output cofiguration of command
- configureOutput
Self configureOutput(OutputConfiguration config)
configure the output of command
- copyInheritedSettings
Self copyInheritedSettings(Command src)
inherit the basic configuration from another command
- description
string description()
get the description of command
- description
Self description(string str, string[string] argsDesc)
set the description of command
- disableHelp
Self disableHelp()
- error
void error(string msg, string code)
invoke error when configuring command
- excessArguments
void excessArguments()
Undocumented in source. Be warned that the author may not have intended to support it.
- execSubCommand
void execSubCommand(string[] unknowns)
Undocumented in source. Be warned that the author may not have intended to support it.
- exportAs
Self exportAs(string flag, string[] aliasFlags)
export the option flag as new flag to sub command, so that this new flag can be pased as the
the option flag of parent command. this member function aims at avoidind flag conflict between
the command and its sub command, after using passThrough on this command.
this function would be automatically call Command.passThrough.
the flag must be the flag of one of the command's option or negate option.
remeber that when parsing the new flag, the option's new flag is prior to the negate option ones.
when parsing command line option flags, imported flag is prior to exported one, and the export one is
prior to the ordinary pass-through option flag.
isNegate decide whether export negate option or non-negate one, default: false
- getArgs
ArgWrap[] getArgs()
get the array of arguments' value wrap by ArgWrap. remember use it after parsing or at the action callabck
- getOptVal
ArgWrap getOptVal(string key)
get the inner value of a option by name wrapped by ArgWrap.
remember better use it in action callabck or after parsing
- getOptVal
T getOptVal(string key)
get the inner value in specified type of an option by flags
- getOptionValSource
Source getOptionValSource(string key)
get the source of option
remember better use it in action callabck or after parsing
- getOpts
inout(OptsWrap) getOpts()
get the options' value map wrap by OptsWrap. remember use it after parsing or at the action callabck
- getSuggestion
string getSuggestion(string flag)
Undocumented in source. Be warned that the author may not have intended to support it.
- getVersion
string getVersion()
get the version string of this command, if not set version, the default is *
- help
void help(bool isErrorMode)
invoke the help if the help support is not disabled
- helpInfo
string helpInfo(bool isErrorMode)
- importAs
Self importAs(string flag, string[] aliasFlags)
import the option flag as new flag from parent command, so that this new flag can be pased as the
the option flag of parent command. this member function aims at avoidind flag conflict between
the command and its parent command, after using passThrough on parent command.
the parent command must exist and parent command must have used passThrough and the flag must
be the flag of one of the parent command's option or negate option.
remeber that when parsing the new flag, the option's new flag is prior to the negate option ones.
when parsing command line option flags, imported flag is prior to exported one, and the export one is
prior to the ordinary pass-through option flag.
isNegate decide whether import negate option or non-negate one, default: false
- injects
Self injects(string name, string[] rest)
inject the options' values exposed by ancestor command by name that are registered
using Command.provides or Command.providesAs, so that we can access this option value.
- injectsAs
Self injectsAs(string name, string asName)
see also Self injects(string name, string[] rest...).
this member function are used for inject an option value as an new name.
this is usually used when you want to avoid name confilict.
- injectsAs
Self injectsAs(string[string] optsMap)
see also Self injectsAs(in string name, in string asName).
inject option values in new names at the same time
- name
Self name(string str)
- name
string name()
- option
Self option(string flags, string desc)
define a value/variadic option to this command
- option
Self option(string flags, string desc)
define a bool option to this command
- option
Self option(string flags, string desc, T defaultValue)
see also Self option(T)(string flags, string desc) and define a default value for this option
- optionMissingArgument
void optionMissingArgument(Option opt)
Undocumented in source. Be warned that the author may not have intended to support it.
- outputHelp
void outputHelp(bool isErrorMode)
Undocumented in source. Be warned that the author may not have intended to support it.
- parse
void parse(string[] argv)
parse the command line argument variables
- parseArguments
void parseArguments(string[] _args)
Undocumented in source. Be warned that the author may not have intended to support it.
- parseConfigOptionsImpl
void parseConfigOptionsImpl(const(JSONValue)* config)
Undocumented in source. Be warned that the author may not have intended to support it.
- parseOptions
Tuple!(string[], string[]) parseOptions(string[] argv)
Undocumented in source. Be warned that the author may not have intended to support it.
- parseOptionsConfig
void parseOptionsConfig()
Undocumented in source. Be warned that the author may not have intended to support it.
- parseOptionsEnv
void parseOptionsEnv()
Undocumented in source. Be warned that the author may not have intended to support it.
- parseOptionsImply
void parseOptionsImply()
Undocumented in source. Be warned that the author may not have intended to support it.
- parsingError
void parsingError(string msg, string code)
invoke error when parsing command line
- passThrough
Self passThrough(bool allow)
whether allow pass through options' flags(config, help, version options are not included)
behind its sub commands, default: false
- provides
Self provides(string name, string[] rest)
expose its option values by names to its sub or sub sub and etc command.
its sub or sub sub and etc command can access these option values using Command.injects by names.
remember that it is only useful for non-builtin options!
- providesAs
Self providesAs(string name, string asName)
see also Self provides(string name, string[] rest...).
this member function are used for register an option to be exposed as an new name.
this is usually used when you want to avoid name confilict.
- providesAs
Self providesAs(string[string] optsMap)
see also Self providesAs(in string name, in string asName).
expose option values in new names at the same time
- requireOption
Self requireOption(string flags, string desc)
define a mandatory bool option to this command
- requiredOption
Self requiredOption(string flags, string desc)
define a mandatory value/variadic option to this command
- requiredOption
Self requiredOption(string flags, string desc, T defaultValue)
see also Self requiredOption(T)(string flags, string desc) and define a default value for this option
- setConfigOption
Self setConfigOption(string flags, string desc, string defaultDir)
set the config option, if flags not defined, then config option's flags is -C, --config <config-dirs...>;
if desc not defined, then description is by default;
if defaultDir not defined, then the defaultDir would be ${CURRENT_WORKER_DIR}, which automatically store the path to dir of config file
- setHelpCommand
Self setHelpCommand(bool enable)
enable or disable the help command
- setHelpCommand
Self setHelpCommand(string flags, string desc)
- setHelpOption
Self setHelpOption(bool enable)
enable the help option or not
- setHelpOption
Self setHelpOption(string flags, string desc)
- setOptionVal
Self setOptionVal(string key, T value)
Undocumented in source. Be warned that the author may not have intended to support it.
- setOptionVal
Self setOptionVal(string key)
Undocumented in source. Be warned that the author may not have intended to support it.
- setOptionVal
Self setOptionVal(string key)
Undocumented in source. Be warned that the author may not have intended to support it.
- setOptionVal
Self setOptionVal(string key, T value, T[] rest)
Undocumented in source. Be warned that the author may not have intended to support it.
- setOptionVal
Self setOptionVal(string key, T[] values)
Undocumented in source. Be warned that the author may not have intended to support it.
- setOptionValDirectly
Self setOptionValDirectly(string key, T value, Source src)
Undocumented in source. Be warned that the author may not have intended to support it.
- setOptionValDirectly
Self setOptionValDirectly(string key, bool value, Source src)
Undocumented in source. Be warned that the author may not have intended to support it.
- setOptionValDirectly
Self setOptionValDirectly(string key, Source src)
Undocumented in source. Be warned that the author may not have intended to support it.
- setVersion
Self setVersion(string str, string flags, string desc)
set the version of the command.
if flags and desc not defined, then it will automatically set the version option flag -V, --version and version command name version
- setVersionCommand
Self setVersionCommand(string flags, string desc)
set version command, see also Self setVersion(string str, string flags = "", string desc = "")
- setVersionOption
Self setVersionOption(string flags, string desc)
set the version option of the command, see also Self setVersion(string str, string flags = "", string desc = "")
- showGlobalOptions
Self showGlobalOptions(bool enable)
whether show the global options when invoke help, default: false
- showHelpAfterError
Self showHelpAfterError(bool displayHelp)
whether show help info when parsing occur error, default: true
- showSuggestionAfterError
Self showSuggestionAfterError(bool displaySuggestion)
whether show suggestion info when parsing occur error, default: true
- sortOptions
Self sortOptions(bool enable)
whether sort sub options when invoke help, default: false
- sortSubCommands
Self sortSubCommands(bool enable)
whether sort sub commands when invoke help, default: false
- unknownOption
void unknownOption(string flag)
Undocumented in source. Be warned that the author may not have intended to support it.
- usage
string usage()
- usage
Self usage(string str)
Command Type