Helper function to construct a UfoOptions object.
4963
function () {
  const options = {};
  options.host = cli.ufo || process.env.LUFO_ADDRESS || '';
  options.password = cli.password || process.env.LUFO_PASSWORD || undefined;
  options.localHost = cli.localHost || process.env.LUFO_LOCALHOST || undefined;
  options.localUdpPort = parseInt(cli.localUdpPort || process.env.LUFO_LOCAL_UDP, 10) || undefined;
  options.remoteUdpPort = parseInt(cli.remoteUdpPort || process.env.LUFO_REMOTE_UDP, 10) || undefined;
  options.localTcpPort = parseInt(cli.localTcpPort || process.env.LUFO_LOCAL_TCP, 10) || undefined;
  options.remoteTcpPort = parseInt(cli.remoteTcpPort || process.env.LUFO_REMOTE_TCP, 10) || undefined;
  options.immediate = parseBoolean(cli.immediate, process.env.LUFO_IMMEDIATE) || undefined;
  return options;
}
452604
function makeOptions(IOD, IODOpts, apiType, reqOpts) {
	var path = IodU.makePath(IOD, IODOpts, apiType)
	var method = apiType === IOD.TYPES.JOB || !_.isEmpty(IODOpts.files) ?
		'post' : IODOpts.method.toLowerCase()

	return _.defaults({
		url: IOD.host + ':' + IOD.port + path,
		path: path,
		method: method,

		// For 'get' request use request `qs` property.
		qs: method === 'get' ?
			_.defaults({ apiKey: IOD.apiKey }, exports.prepareParams(IODOpts.params)) : undefined,

		// For 'post' request with no files use `form` property
		form: method === 'post' && !IODOpts.files ?
			_.defaults({ apiKey: IOD.apiKey }, exports.prepareParams(IODOpts.params)) : undefined
	}, reqOpts, IOD.reqOpts)
}
1208953
def options(cls):
        """"""
        return {k: v for k, v in cls.__dict__.items() if isinstance(v, Option)}
806236
def _objs_opts(objs, all=None, **opts):
    '''
    '''
    if objs:  # given objects
        t = objs
    elif all in (False, None):
        t = ()
    elif all is True:  # 'all' objects ...
         # ... modules first, globals and stack
         # (may contain duplicate objects)
        t = tuple(_values(sys.modules)) + (
            globals(), stack(sys.getrecursionlimit())[2:])
    else:
        raise ValueError('invalid option: %s=%r' % ('all', all))
    return t, opts
593546
def from_kwargs(cls, **kwargs):
        """"""
        config = cls()
        for slot in cls.__slots__:

            if slot.startswith('_'):
                slot = slot[1:]
            setattr(config, slot, kwargs.pop(slot, cls.get_default(slot)))

        if kwargs:
            raise ValueError("Unrecognized option(s): {}".format(kwargs.keys()))
        return config
524150
function normalizeOptions(options, Ctor) {
  if (!options) {
    return null;
  }

  if (options instanceof Ctor) {
    return options;
  }

  var instance = new Ctor();

  Object.keys(options).forEach(function(key) {
    if (typeof options[key] !== "undefined") {
      instance[key] = options[key];
    }
  });

  return instance;
}
909232
private static Options constructOptions() {
    Options options = new Options();

    Option cluster = Option.builder("c")
        .desc("Cluster name in which the topology needs to run on")
        .longOpt("cluster")
        .hasArgs()
        .argName("cluster")
        .required()
        .build();

    Option role = Option.builder("r")
        .desc("Role under which the topology needs to run")
        .longOpt("role")
        .hasArgs()
        .argName("role")
        .required()
        .build();

    Option environment = Option.builder("e")
        .desc("Environment under which the topology needs to run")
        .longOpt("environment")
        .hasArgs()
        .argName("environment")
        .required()
        .build();

    Option submitUser = Option.builder("s")
        .desc("User submitting the topology")
        .longOpt("submit_user")
        .hasArgs()
        .argName("submit userid")
        .required()
        .build();

    Option topologyName = Option.builder("n")
        .desc("Name of the topology")
        .longOpt("topology_name")
        .hasArgs()
        .argName("topology name")
        .required()
        .build();

    Option heronHome = Option.builder("d")
        .desc("Directory where heron is installed")
        .longOpt("heron_home")
        .hasArgs()
        .argName("heron home dir")
        .required()
        .build();

    Option componentParallelism = Option.builder("a")
        .desc("Component parallelism to update: <name>:<value>,<name>:<value>,...")
        .longOpt("component_parallelism")
        .hasArgs()
        .argName("component parallelism")
        .build();

    Option containerNumber = Option.builder("cn")
        .desc("Container Number for updation: <value>")
        .longOpt("container_number")
        .hasArgs()
        .argName("container number")
        .build();

    Option runtimeConfig = Option.builder("rc")
        .desc("Runtime config to update: [comp:]<name>:<value>,[comp:]<name>:<value>,...")
        .longOpt("runtime_config")
        .hasArgs()
        .argName("runtime config")
        .build();

    Option configFile = Option.builder("p")
        .desc("Path of the config files")
        .longOpt("config_path")
        .hasArgs()
        .argName("config path")
        .required()
        .build();

    Option configOverrides = Option.builder("o")
        .desc("Command line override config path")
        .longOpt("override_config_file")
        .hasArgs()
        .argName("override config file")
        .build();

    Option releaseFile = Option.builder("b")
        .desc("Release file name")
        .longOpt("release_file")
        .hasArgs()
        .argName("release information")
        .build();

    Option command = Option.builder("m")
        .desc("Command to run")
        .longOpt("command")
        .hasArgs()
        .required()
        .argName("command to run")
        .build();

    Option containerId = Option.builder("i")
        .desc("Container Id for restart command")
        .longOpt("container_id")
        .hasArgs()
        .argName("container id")
        .build();

    Option dryRun = Option.builder("u")
        .desc("run in dry-run mode")
        .longOpt("dry_run")
        .required(false)
        .build();

    Option dryRunFormat = Option.builder("t")
        .desc("dry-run format")
        .longOpt("dry_run_format")
        .hasArg()
        .required(false)
        .build();

    Option verbose = Option.builder("v")
        .desc("Enable debug logs")
        .longOpt("verbose")
        .build();

    options.addOption(cluster);
    options.addOption(role);
    options.addOption(environment);
    options.addOption(submitUser);
    options.addOption(topologyName);
    options.addOption(configFile);
    options.addOption(configOverrides);
    options.addOption(releaseFile);
    options.addOption(command);
    options.addOption(heronHome);
    options.addOption(containerId);
    options.addOption(componentParallelism);
    options.addOption(containerNumber);
    options.addOption(runtimeConfig);
    options.addOption(dryRun);
    options.addOption(dryRunFormat);
    options.addOption(verbose);

    return options;
  }
788071
function mergeDefaultOptions(opts) {
    const copy = {};
    copyKeys(copy, _defaultOptions);
    copyKeys(copy, opts);
    Object.keys(_defaultOptions).forEach((key) => {
        const obj = _defaultOptions[key];
        if (typeof obj === 'object') {
            const objCopy = {};
            copyKeys(objCopy, obj);
            copyKeys(objCopy, copy[key]);
            copy[key] = objCopy;
        }
    });
    return copy;
}
711611
function createOptions( options ) {
    var object = optionsCache[ options ] = {};
    _each( options.split( /\s+/ ), function( flag ) {
      object[ flag ] = true;
    });
    return object;
  }
677301
def _options():
    """"""
    opts = sys.argv[1:]
    return [click.Option((v.split('=')[0],)) for v in opts
            if v[0] == '-' and v != '--help']
851184
function unknownOption (flag, type = 'option') {
  if (this._allowUnknownOption) return

  logger.error()
  logger.error(`  error: unknown ${type}:`, flag)
  logger.error()
  this.outputHelp()
  util.exit(1)
}
45507
function extendDefaultOptions(options) {
  return Object.assign({
    dir: DEFAULT_DIRECTORY,
    extensions: DEFAULT_EXTENSIONS,
    params: DEFAULT_PARAMS
  }, options);
}
1121021
public static MOAObject fromOption(ClassOption option) {
  	return MOAUtils.fromCommandLine(option.getRequiredType(), option.getValueAsCLIString());
  }
60419
function options (userOpts) {
  if (appLoaded && typeof userOpts === 'undefined') {
    return appOptions
  }
  userOpts = typeof userOpts === 'object' ? userOpts : {}
  appOptions = Object.assign({}, defaults, userOpts)
  appOptions.paths = Object.assign({}, defaults.paths, userOpts.paths)
  appLoaded = true

  return appOptions
}
304391
function _createOptions(config) {
  return {
    filename:config.filename,
    displayErrors:true,
    timeout: config.timeout || 20*1000
  };
}
29922
def cmd_auxopt(self, args):
        ''''''
        if self.mpstate.vehicle_type != 'copter':
            print("This command is only available for copter")
            return
        if len(args) == 0 or args[0] not in ('set', 'show', 'reset', 'list'):
            print("Usage: auxopt set|show|reset|list")
            return
        if args[0] == 'list':
            print("Options available:")
            for s in sorted(aux_options.keys()):
                print('  ' + s)
        elif args[0] == 'show':
            if len(args) > 2 and args[1] not in ['7', '8', 'all']:
                print("Usage: auxopt show [7|8|all]")
                return
            if len(args) < 2 or args[1] == 'all':
                self.aux_show('7')
                self.aux_show('8')
                return
            self.aux_show(args[1])
        elif args[0] == 'reset':
            if len(args) < 2 or args[1] not in ['7', '8', 'all']:
                print("Usage: auxopt reset 7|8|all")
                return
            if args[1] == 'all':
                self.param_set('CH7_OPT', '0')
                self.param_set('CH8_OPT', '0')
                return
            param = "CH%s_OPT" % args[1]
            self.param_set(param, '0')
        elif args[0] == 'set':
            if len(args) < 3 or args[1] not in ['7', '8']:
                print("Usage: auxopt set 7|8 OPTION")
                return
            option = self.aux_option_validate(args[2])
            if not option:
                print("Invalid option " + args[2])
                return
            param = "CH%s_OPT" % args[1]
            self.param_set(param, aux_options[option])
        else:
            print("Usage: auxopt set|show|list")
130549
def construct_docstring(options):
        """"""
        s = "\nParameters\n"
        s += "----------\n\n"
        for key, opt in options.items():
            s += "%s : %s\n      %s [%s]\n" % (key, str(opt[2]),
                                               str(opt[1]), str(opt[0]))
        return s