- All Superinterfaces:
ArgumentContainer,ArgumentParser
- All Known Implementing Classes:
SubparserImpl
This interface defines Subparser used to add sub-command to
ArgumentParser.
-
Method Summary
Modifier and TypeMethodDescriptionSets alias names for this Subparser.defaultHelp(boolean defaultHelp) If defaultHelp istrue, the default values of arguments are printed in help message.description(String description) Sets the description for the arguments of this container.Sets the text to display after the argument help.Sets the text to display in help message.help(FeatureControl ctrl) Sets special value to control help message handling.setDefault(String dest, Object value) Sets parser-level default value of attributedest.setDefaults(Map<String, Object> attrs) Sets parser-level default values fromattrs.Sets version string.Methods inherited from interface net.sourceforge.argparse4j.inf.ArgumentContainer
addArgumentMethods inherited from interface net.sourceforge.argparse4j.inf.ArgumentParser
addArgumentGroup, addMutuallyExclusiveGroup, addMutuallyExclusiveGroup, addSubparsers, formatHelp, formatUsage, formatVersion, getConfig, getDefault, handleError, handleError, parseArgs, parseArgs, parseArgs, parseArgs, parseArgsOrFail, parseKnownArgs, parseKnownArgs, parseKnownArgs, parseKnownArgs, parseKnownArgsOrFail, printHelp, printHelp, printUsage, printUsage, printVersion, printVersion, usage
-
Method Details
-
description
Description copied from interface:ArgumentContainerSets the description for the arguments of this container.- Specified by:
descriptionin interfaceArgumentContainer- Specified by:
descriptionin interfaceArgumentParser- Parameters:
description- The description of this container.- Returns:
- this
-
epilog
Description copied from interface:ArgumentParserSets the text to display after the argument help.- Specified by:
epilogin interfaceArgumentParser- Parameters:
epilog- The text to display after the argument help.- Returns:
- this
-
version
Description copied from interface:ArgumentParserSets version string. It will be displayed
ArgumentParser.printVersion().If the given usage contains
${prog}string, it will be replaced with the program name given inArgumentParsers.newArgumentParser(String). This processed text will be printed without text-wrapping.- Specified by:
versionin interfaceArgumentParser- Parameters:
version- The version string.- Returns:
- this
-
defaultHelp
Description copied from interface:ArgumentParserIf defaultHelp is
true, the default values of arguments are printed in help message.By default, the default values are not printed in help message.
- Specified by:
defaultHelpin interfaceArgumentParser- Parameters:
defaultHelp- Switch to display the default value in help message.- Returns:
- this
-
setDefault
Description copied from interface:ArgumentParserSets parser-level default value of attribute
dest.The parser-level defaults always override argument-level defaults.
- Specified by:
setDefaultin interfaceArgumentParser- Parameters:
dest- The attribute name.value- The default value.- Returns:
- this
-
setDefaults
Description copied from interface:ArgumentParserSets parser-level default values from
attrs.All key-value pair in
attrsare registered to parser-level defaults. The parser-level defaults always override argument-level defaults.- Specified by:
setDefaultsin interfaceArgumentParser- Parameters:
attrs- The parser-level default values to add.- Returns:
- this
-
help
Sets the text to display in help message.- Parameters:
help- The text to display in help message.- Returns:
- this
-
help
Sets special value to control help message handling.
Currently, only
FeatureControl.SUPPRESSis available. If it is given, the help entry for this Subparser is not displayed in the help message.- Parameters:
ctrl- The special value to control help message handling.- Returns:
- this
- Since:
- 0.8.0
-
aliases
Sets alias names for this Subparser. The alias names must be unique for eachSubparsersinstance which this object belongs to.- Parameters:
alias- Alias name for this Subparser.- Returns:
- this
-