Class ArgumentGroupImpl

    • Field Detail

      • title_

        private final java.lang.String title_
      • description_

        private java.lang.String description_
      • mutex_

        private boolean mutex_
        true if this is a mutually exclusive group.
      • required_

        private boolean required_
        true if one of the arguments in this group must be specified.
    • Constructor Detail

      • ArgumentGroupImpl

        ArgumentGroupImpl​(ArgumentParserImpl argumentParser,
                          java.lang.String title)
    • Method Detail

      • addArgument

        public ArgumentImpl addArgument​(java.lang.String... nameOrFlags)
        Description copied from interface: ArgumentContainer

        Creates new Argument, adds it to this container and returns it.

        The nameOrFlags is either a single name of positional argument or a list of option strings for named argument, e.g. foo or -f, --foo.

        Specified by:
        addArgument in interface ArgumentContainer
        Parameters:
        nameOrFlags - A name or a list of option strings of new Argument.
        Returns:
        Argument object.
      • required

        public ArgumentGroupImpl required​(boolean required)
        Description copied from interface: MutuallyExclusiveGroup

        If true is given, one of the arguments in this group must be specified otherwise error will be issued.

        The default value is false.

        Specified by:
        required in interface MutuallyExclusiveGroup
        Parameters:
        required - true or false
        Returns:
        this
      • printHelp

        public void printHelp​(java.io.PrintWriter writer,
                              int format_width)
      • getIndex

        int getIndex()
      • setIndex

        void setIndex​(int index)
      • isMutex

        boolean isMutex()
      • setMutex

        void setMutex​(boolean mutex)
      • isRequired

        public boolean isRequired()
      • isSeparateHelp

        boolean isSeparateHelp()
        Returns true if the help message for this group should be in separate group.
        Returns:
        true if the help message for this group should be in separate group.