Initialize new CommandLine::Option
 <tt>name</tt> The name of the flag
 <tt>definition</tt> The definition of the flag.
760259
def parse(arguments_parser)
      if @parameter_count == 0
        return true
      elsif @parameter_count == 1
        parameter = arguments_parser.next_parameter
        fail CommandLine::ParameterExpected, self if parameter.nil?
        return parameter
      elsif @parameter_count == :any
        parameters = []
        while parameter = arguments_parser.next_parameter && parameter != '--'
          parameters << parameter
        end
        return parameters
      else
        parameters = []
        @parameter_count.times do |_n|
          parameter = arguments_parser.next_parameter
          fail CommandLine::ParameterExpected, self if parameter.nil?
          parameters << parameter
        end
        return parameters
      end
    end
536928
def field(name, **options)
      name = name.to_sym
      definitions[name] = options
      proxy.instance_eval do
        define_method(name) { fields[name] }
        define_method("#{name}=") { |value| fields[name] = value }
      end
    end
1048938
function Option(flags, description) {
  this.flags = flags;
  this.required = ~flags.indexOf('<');
  this.optional = ~flags.indexOf('[');
  this.bool = !~flags.indexOf('-no-');
  flags = flags.split(/[ ,|]+/);
  if (flags.length > 1 && !/^[[<]/.test(flags[1])) this.short = flags.shift();
  this.long = flags.shift();
  this.description = description || '';
}
862115
def declare(options)
      options.each do |key, value|
        instance_variable_set("@#{key}".to_sym, options[key])
        env.logger.info("definition") { " - #{key} : #{options[key]}" }
      end

    end
845802
def setCmdline(self,value=1):
        """"""
        # set through dictionary to avoid extra calls to __setattr__
        if value:
            self.__dict__['flags'] = self.flags | _cmdlineFlag
        else:
            self.__dict__['flags'] = self.flags & ~_cmdlineFlag
219590
function parentName (options) {
  function instantiate (input) {
    if (/^[A-Z]{3}/.test(input)) {
      return input.replace(/^([A-Z]+)([A-Z])/, function (str, p1, p2) {
        return p1.toLowerCase() + p2
      })
    } else {
      return input.charAt(0).toLowerCase() + input.slice(1)
    }
  }

  /* don't bother with a parentName for exported identifiers */
  if (this.isExported) return ''

  if (this.memberof && this.kind !== 'constructor') {
    var parent = arrayify(options.data.root).find(where({ id: this.memberof }))
    if (parent) {
      if (this.scope === 'instance') {
        var name = parent.typicalname || parent.name
        return instantiate(name)
      } else if (this.scope === 'static' && !(parent.kind === 'class' || parent.kind === 'constructor')) {
        return parent.typicalname || parent.name
      } else {
        return parent.name
      }
    } else {
      return this.memberof
    }
  }
}
537410
protected function init()
    {
        $this->addCommand(new SyncCommand());
        $this->addCommand(new MakesumCommand());

        $this->addGlobalOption('e')
            ->alias('env')
            ->description('The environment application name or class.')
            ->defaultValue('dev');
    }
680329
public function initializeArguments()
    {
        parent::initializeArguments();
        $this->registerArgument('options', OptionCollection::class, 'The facets that should be filtered', true);
        $this->registerArgument('prefix', 'string', 'The prefix where options should be filtered on', true);
    }
360910
def DEFINE_point(name, default, help):  # pylint: disable=invalid-name,redefined-builtin
  """"""
  flags.DEFINE(PointParser(), name, default, help)
491888
def init(self, rules):
        """"""
        # Initialize the option parser
        for dest in rules.keys():
            rule = rules[dest]

            # Assign defaults ourselves here, instead of in the option parser
            # itself in order to allow for multiple calls to parse (dont want
            # subsequent calls to override previous values with default vals).
            if 'default' in rule:
                self.result['kwargs'][dest] = rule['default']

            flags = rule['flags']
            kwargs = { 'action': rule.get('action', "store") }
            # NOTE: Don't provision the parser with defaults here, per above.
            for key in ['callback', 'help', 'metavar', 'type']:
                if key in rule: kwargs[key] = rule[key]
            self.add_option(*flags, dest=dest, **kwargs)

            # Remember the dest vars that we see, so that we can merge results
            self.dests.add(dest)
1064725
def parse_name_options(name, arg_split:':', **keywords)
			name,*options=name.split(arg_split)
			return name, parse_options(options, arg_split: arg_split, **keywords)
		end
1364488
def define(
    name: str,
    default: Any = None,
    type: type = None,
    help: str = None,
    metavar: str = None,
    multiple: bool = False,
    group: str = None,
    callback: Callable[[Any], None] = None,
) -> None:
    
    return options.define(
        name,
        default=default,
        type=type,
        help=help,
        metavar=metavar,
        multiple=multiple,
        group=group,
        callback=callback,
    )
912739
function(options) {
		var program = new Commander();
		if (options) {
			//hack to emulate process.argv
			options.unshift('', '');
		}
		//process short command names
		var args = options || process.argv.slice();
		var command = args[2];
		var validCommand = config.aliases[command];

		if (validCommand) {
			args[2] = validCommand;
		}
		program.parse(args);
	}
949268
def _configure_using_fluent_definition(self):
        
        definition = Parser.parse(self.signature)

        self._config.set_name(definition["name"])

        for name, flags, description, default in definition["arguments"]:
            self._config.add_argument(name, flags, description, default)

        for long_name, short_name, flags, description, default in definition["options"]:
            self._config.add_option(long_name, short_name, flags, description, default)
687081
def default_command(command_name = nil)
      if command_name
        if commands.key?(command_name)
          @default_command = commands[command_name] if command_name
          @default_command
        else
          raise ArgumentError, "'#{command_name}' couldn't be found in this command's list of commands."
        end
      else
        @default_command
      end
    end
92793
def define_value(short_name, long_name, description, flag, default_value, validate = nil)
			short_name = short_name.to_s
			long_name = long_name.to_s
			
			if (short_name.length != 1)
				raise ArgumentError, "Short name must be one character long (#{short_name})"
			end
			if (long_name.length < 2)
				raise ArgumentError, "Long name must be more than one character long (#{long_name})"
			end
			
			info = Info.new(short_name, long_name, description, flag, default_value, nil, validate)
			@options[long_name] = info
			@options[short_name] = info
			
			@order.push(info)
			
			method_name = long_name.gsub('-','_')
			method_name << "?" if (flag)
			(class <<self; self; end).class_eval do
				define_method(method_name.to_sym) do
					return @options[long_name].value || @options[long_name].default_value
				end
			end
			
			return self
		end
904928
def setnil(self, flag=True):
        
        p, u = Namespace.xsins
        name = ":".join((p, "nil"))
        self.set(name, str(flag).lower())
        self.addPrefix(p, u)
        if flag:
            self.text = None
        return self