Interface Subparser

All Superinterfaces:
ArgumentContainer, ArgumentParser
All Known Implementing Classes:
SubparserImpl

public interface Subparser extends ArgumentParser

This interface defines Subparser used to add sub-command to ArgumentParser.

  • Method Details

    • description

      Subparser description(String description)
      Description copied from interface: ArgumentContainer
      Sets the description for the arguments of this container.
      Specified by:
      description in interface ArgumentContainer
      Specified by:
      description in interface ArgumentParser
      Parameters:
      description - The description of this container.
      Returns:
      this
    • epilog

      Subparser epilog(String epilog)
      Description copied from interface: ArgumentParser
      Sets the text to display after the argument help.
      Specified by:
      epilog in interface ArgumentParser
      Parameters:
      epilog - The text to display after the argument help.
      Returns:
      this
    • version

      Subparser version(String version)
      Description copied from interface: ArgumentParser

      Sets version string. It will be displayed ArgumentParser.printVersion().

      If the given usage contains ${prog} string, it will be replaced with the program name given in ArgumentParsers.newArgumentParser(String). This processed text will be printed without text-wrapping.

      Specified by:
      version in interface ArgumentParser
      Parameters:
      version - The version string.
      Returns:
      this
    • defaultHelp

      Subparser defaultHelp(boolean defaultHelp)
      Description copied from interface: ArgumentParser

      If 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:
      defaultHelp in interface ArgumentParser
      Parameters:
      defaultHelp - Switch to display the default value in help message.
      Returns:
      this
    • setDefault

      Subparser setDefault(String dest, Object value)
      Description copied from interface: ArgumentParser

      Sets parser-level default value of attribute dest.

      The parser-level defaults always override argument-level defaults.

      Specified by:
      setDefault in interface ArgumentParser
      Parameters:
      dest - The attribute name.
      value - The default value.
      Returns:
      this
    • setDefaults

      Subparser setDefaults(Map<String,Object> attrs)
      Description copied from interface: ArgumentParser

      Sets parser-level default values from attrs.

      All key-value pair in attrs are registered to parser-level defaults. The parser-level defaults always override argument-level defaults.

      Specified by:
      setDefaults in interface ArgumentParser
      Parameters:
      attrs - The parser-level default values to add.
      Returns:
      this
    • help

      Subparser help(String 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.SUPPRESS is 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

      Subparser aliases(String... alias)
      Sets alias names for this Subparser. The alias names must be unique for each Subparsers instance which this object belongs to.
      Parameters:
      alias - Alias name for this Subparser.
      Returns:
      this