Adds the specified argument to the command-line definition.

 @param arg [Argument] An Argument sub-class to be added to the command-
   line definition.
323757
def <<(arg)
            case arg
            when PositionalArgument, KeywordArgument, FlagArgument, RestArgument
                if @arguments[arg.key]
                    raise ArgumentError, "An argument with key '#{arg.key}' has already been defined"
                end
                if arg.short_key && @short_keys[arg.short_key]
                    raise ArgumentError, "The short key '#{arg.short_key}' has already been registered by the '#{
                        @short_keys[arg.short_key]}' argument"
                end
                if arg.is_a?(RestArgument) && rest_args
                    raise ArgumentError, "Only one rest argument can be defined"
                end
                @arguments[arg.key] = arg
                @short_keys[arg.short_key] = arg if arg.short_key
            else
                raise ArgumentError, "arg must be an instance of PositionalArgument, KeywordArgument, " +
                    "FlagArgument or RestArgument"
            end
        end
138209
def _add(self, name, *args, **kw):
        
        argname = list(self.argdict)[self._argno]
        if argname != name:
            raise NameError(
                'Setting argument %s, but it should be %s' % (name, argname))
        self._group.add_argument(*args, **kw)
        self.all_arguments.append((args, kw))
        self.names.append(name)
        self._argno += 1
1332067
def add_gnu_argument(self, *args, **kwargs):
    ""

    gnu_args = []

    for arg in args:
        # Fix if we have at least 3 chars where the first is a hyphen
        # and the second is not a hyphen (e.g. -op becomes --op)
        if len(arg) > 3 and arg[0] == '-' and arg[1] != '-':
            gnu_args.append('-' + arg)
        else:
            gnu_args.append(arg)

    argparse.ArgumentParser.add_argument(self, *gnu_args, **kwargs)
109448
def _add_arg(self, key, value, mask=False):
        
        if self.lang == 'python':
            self._add_arg_python(key, value, mask)
        elif self.lang == 'java':
            self._add_arg_java(key, value, mask)
965268
def add_argument(self, *args, **kwargs):
        
        defhelp = kwargs.pop("help", None)
        defaults = kwargs.pop("default", None)
        default = defaults if self.use_defaults else None
        if not defhelp or default is None or kwargs.get('action') == 'help':
            return super().add_argument(*args, help=defhelp, default=default, **kwargs)
        else:
            return super().add_argument(*args, help=defhelp + " (default: {})".format(default),
                                        default=default, **kwargs)
267018
def add_argument_to(self, parser):
        
        from devassistant.cli.devassistant_argparse import DefaultIffUsedActionFactory
        if isinstance(self.kwargs.get('action', ''), list):
            # see documentation of DefaultIffUsedActionFactory to see why this is necessary
            if self.kwargs['action'][0] == 'default_iff_used':
                self.kwargs['action'] = DefaultIffUsedActionFactory.generate_action(
                    self.kwargs['action'][1])
        # In cli 'preserved' is not supported.
        # It needs to be removed because it is unknown for argparse.
        self.kwargs.pop('preserved', None)
        try:
            parser.add_argument(*self.flags, **self.kwargs)
        except Exception as ex:
            problem = "Error while adding argument '{name}': {error}".\
                format(name=self.name, error=repr(ex))
            raise exceptions.ExecutionException(problem)
806150
def _add_default_arguments(parser):
    
    parser.add_argument('-c', '--config', action='store', dest='config',
                        help='Path to the configuration file')
    parser.add_argument('-f', '--foreground', action='store_true', dest='foreground',
                        help='Run the application interactively')
1115555
def add_arguments(self, parser):
        """"""
        # Add the underlying test command arguments first
        test_command = TestCommand()
        test_command.add_arguments(parser)

        for option in OPTIONS:
            parser.add_argument(*option[0], **option[1])
838322
def add_argument(self, *args, parser=None, autoenv=False, env=None,
                     complete=None, **kwargs):
        
        if parser is None:
            parser = self.argparser
        action = parser.add_argument(*args, **kwargs)
        if autoenv:
            if env is not None:
                raise TypeError('Arguments `env` and `autoenv` are mutually '
                                'exclusive')
            env = self._make_autoenv(action)
        if env:
            self.argparser.bind_env(action, env)
            if autoenv:
                self._autoenv_actions.add(action)
        if complete:
            action.complete = complete
        return action
1122461
def add_argument(*args, **kwargs):
    

    def decorator(func):
        func = ScriptAdaptor._wrap(func)
        func._add_argument(args, kwargs)
        return func
    return decorator
1226838
def modify_args(args)
      if @command.default_option && @command.numerical_arg_size? &&
        @command.arg_size <= 1 &&
        !args[0].is_a?(Hash) && args[0].to_s[/./] != '-' && !args.join.empty?
          args[0] = "--#{@command.default_option}=#{args[0]}"
      end
    end
426918
def add_arguments(self, parser):
        '''

        '''
        commands = set(name[3:] for name in dir(self) if name.startswith('do_'))
        parser.add_argument('action', help='action to run', nargs='?',
                            choices=list(commands))
        parser.add_argument('arguments', help='arguments specific to ACTION',
                            nargs=argparse.REMAINDER)
913481
def add_raw_arg(self, arg):
        
        if not isinstance(arg, File):
            arg = str(arg)

        self._raw_options += [arg]
87117
def add_arguments(parser, default_level=logging.INFO):
	
	adder = (
		getattr(parser, 'add_argument', None)
		or getattr(parser, 'add_option')
	)
	adder(
		'-l', '--log-level', default=default_level, type=log_level,
		help="Set log level (DEBUG, INFO, WARNING, ERROR)")
1251401
def _add_resend_arg(arg_parser, resend_help):
    
    arg_parser.add_argument("--resend",
                            action='store_true',
                            default=False,
                            dest='resend',
                            help=resend_help)
421864
def AddArg(self, argument):
    
    self.args.append(argument)
    if len(self.args) > self.number_of_args:
      raise errors.ParseError('Too many arguments for this expression.')

    elif len(self.args) == self.number_of_args:
      return True

    return False
630990
public CmdLineAction arg(String arg) {
		if (!CmdLineProcessor.isActionArg(arg)) {
			throw new IllegalArgumentException(arg);
		}
		this.args.add(arg);
		return this;
	}