Public: Initialize a Client.

 opts = {} - a Hash of options to override the defaults in DEFAULTS
 Public: Run a command on the Client instance

 command - the command string
 *args - any arguments to send
320233
def run(command, *args)
      receive_loop # start the loop

      send_args     args.flatten
      send_env      opts[:env]
      send_dir      opts[:dir]
      send_command  command
      send_stdin    opts[:stdin]

      receive_loop.join
      return nil
    end
613766
function parseOptions(opts) {
    opts = opts || {};
    if (toString.call(opts) === '[object String]') {
        opts = {
            directory: opts
        };
    }

    opts.cwd = opts.cwd || process.cwd();

    log.verbosity = toString.call(opts.verbosity) === '[object Number]' ? opts.verbosity : DEFAULT_VERBOSITY;
    delete (opts.verbosity);

    cmd = opts.cmd || DEFAULT_CMD;
    delete (opts.cmd);

    // enable bower prompting but ignore the actual prompt if interactive == false
    enablePrompt = opts.interactive || DEFAULT_INTERACTIVE;
    opts.interactive = true;

    if (!opts.directory) {
        opts.directory = getDirectoryFromBowerRc(opts.cwd) || DEFAULT_DIRECTORY;
    }

    return opts;
}
1173646
function (opts, cb) {
            var self = this;
            cb = cb || function () {
                };
            opts = opts || {};
            var url = this._geturi(opts);
            this.client.get({
                uri: url
            }, cb);
        }
129193
def set_opts(opts)
      opts.on('-s', '--stdin', 'Read input from standard input instead of an input file') do
        @options[:input] = $stdin
      end

      opts.on('--trace', 'Show a full traceback on error') do
        @options[:trace] = true
      end

      opts.on('-c', '--compile', 'Compile only but do not run') do
        @options[:compile] = true
      end

      opts.on('-e', '--erb', 'Convert to ERB') do
        @options[:erb] = true
      end

      opts.on('--rails', 'Generate rails compatible code (Implies --compile)') do
        Engine.set_options disable_capture: true, generator: Temple::Generators::RailsOutputBuffer
        @options[:compile] = true
      end

      opts.on('-r', '--require library', "Load library or plugin with -r slim/plugin") do |lib|
        require lib.strip
      end

      opts.on('-p', '--pretty', 'Produce pretty html') do
        Engine.set_options pretty: true
      end

      opts.on('-o', '--option name=code', String, 'Set slim option') do |str|
        parts = str.split('=', 2)
        Engine.options[parts.first.gsub(/\A:/, '').to_sym] = eval(parts.last)
      end

      opts.on('-l', '--locals Hash|YAML|JSON', String, 'Set local variables') do |locals|
        @options[:locals] =
          if locals =~ /\A\s*\{\s*\p{Word}+:/
            eval(locals)
          else
            require 'yaml'
            if RUBY_ENGINE == 'rbx'
              begin
                require 'psych'
              rescue LoadError
                $stderr.puts 'Please install psych gem as Rubunius ships with an old YAML engine.'
              end
            end
            YAML.load(locals)
          end
      end

      opts.on_tail('-h', '--help', 'Show this message') do
        puts opts
        exit
      end

      opts.on_tail('-v', '--version', 'Print version') do
        puts "Slim #{VERSION}"
        exit
      end
    end
1029399
function buildOpts (keys) {
  var opts = {}
  var pairs = _.pairs(keys)
  for (var i in pairs) {
    var argvKey = pairs[i][0]
    var envKey = argvKey.toUpperCase()
    var configKey = pairs[i][1]
    opts[configKey] = argv[argvKey] || config.get(configKey)
    if (opts[configKey] === null) {
      throw Error("The environment variable '" + envKey + "', or command line parameter '--" + argvKey + "' must be set.")
    }
  }
  return opts
}
732699
def execute(opts={})
      @result = result_class.new(session.execute(statement, execution_options.merge(opts)), result_opts)
      result.success?
    end
802380
function opt (option) {
  return function (value) {
    if (typeof value === 'undefined') {
      return nn.Getopt(this.binding, nn.NN_SOL_SOCKET, sol[option]);
    }

    if(nn.Setopt(this.binding, nn.NN_SOL_SOCKET, sol[option], value) > -1) {
      return true;
    }

    throw new Error(nn.Err() + ': ' + this.type + option + '@' + value + '\n');
  }
}
1026430
function Client(opts) {

    this.opts = new clientOptions(opts)
    this.streamData = {}
    this.currentIndex = 0
    this.cachedItems = new lru({maxSize: this.opts.maxCacheSize})
}
571122
function loadFromOptions(opts) {
  var defCfg = loadDefault()
  var cfg = opts.config ? loadFromFile(opts.config) : loadDefault()

  // Command line config override file loaded config
  for (var k in opts) {
    defCfg.hasOwnProperty(k) && (defCfg[k] !== opts[k] && (cfg[k] = opts[k]))
  }

  return cfg
}
1312535
function Account (client, opts) {
  var self = this
  if (!(self instanceof Account)) return new Account(client, opts)
  if (!opts) opts = {}

  self.client = client
}
1270783
def _init_command_data(params)
      # set state
      @state = {
        result: true,
        errors: []
      }

      # set options
      initial_options = {
        exceptions: false,
        nullify_empty_params: false
      }
      default_options = _safe_default_options || {}
      params_options = params[:_options] || {}
      @options = initial_options.merge(default_options)
                                .merge(params_options)

      # set other data
      @params = params
    end
1014956
def init_options_parser(options)
      OptionParser.new do |opts|
        opts.banner = "Usage:\n"\
        "\tsshez add <alias> (role@host) [options]\n"\
        "\tsshez connect <alias>\n"\
        "\tsshez remove <alias>\n\tsshez list\n"\
        "\tsshez reset\n"
        opts.separator ''
        opts.separator 'Specific options:'
        options_for_add(opts, options)
        # signals that we are in testing mode
        opts.on('-t', '--test', 'Writes nothing') {options.test = true}
        common_options(opts, options)
      end # OptionParser.new
    end
732086
def input(self, opt):
        

        for key in self.command['input']:
            if (key == opt) or (self.command['input'][key]['name'] == opt):
                return self._send_command(['input', key, 'command'])
        return False
1173440
function setOptName(opt, optKey) {
    var key$ = optKey + '$';
    opts[key$] = opts[key$] || {};
    var name = opt.name || fspath.basename(opt.path);
    while (opts[key$][name]) {
      name = '_' + name;
    }
    opts[key$][name] = opt;
    opt.name = name;
  }
622175
function(opts) {
  this._emitter = new events.EventEmitter();
  this._libpath = opts.path;
  this._tox = opts.tox;
  this._library = this.createLibrary(this._libpath);
  this._initCallbacks();
}
805804
def _opt_to_args(cls, opt, val):
        
        no_value = (
            "alloptions", "all-logs", "batch", "build", "debug",
            "experimental", "list-plugins", "list-presets", "list-profiles",
            "noreport", "quiet", "verify"
        )
        count = ("verbose",)
        if opt in no_value:
            return ["--%s" % opt]
        if opt in count:
            return ["--%s" % opt for d in range(0, int(val))]
        return ["--" + opt + "=" + val]
1265679
function load(opts, cb) {
  if(typeof opts === 'function') {
    cb = opts;
    opts = null;
  }

  var args = opts && opts.args ? opts.args : null
    , defaults = path.normalize(path.join(__dirname, 'command'));
  opts = opts || argv(args);

  if(opts.commands === undefined) {
    opts.commands = [defaults];
  }else if(Array.isArray(opts.commands) && opts.defaults) {
    opts.commands.unshift(defaults);
  }

  function onConfigError(err) {
    //console.dir(err);
    console.error(err.message);
    if(process.env.NODE_ENV !== Constants.TEST) {
      process.exit(1);
    }
  }

  this.conf.once('error', onConfigError.bind(this));

  function onConfigLoad() {
    // if we loaded ok we are done with fatal config errors
    // config set/rewrite need to catch errors now
    this.conf.removeAllListeners('error');

    this.emit('config', this.conf);

    opts.conf = this.conf;

    // spawning the daemon process
    if(this.conf.get(ConfigKey.DAEMONIZE) && !this._daemonized) {
      var pid = daemon(
        path.join(__dirname, 'daemonize.js'), this.conf, opts.args);
      if(cb) cb(pid);
      return;
    }

    this.log.notice('cwd: %s', process.cwd());

    // pass configured timeout to script manager
    ScriptManager.timeout = this.conf.get(ConfigKey.LUA_TIME_LIMIT);

    // spawn now, makes first script executions faster
    // later this should be configurable - allow disabling all
    // scripting
    ScriptManager.spawn();

    // load commands
    return loader(opts, onCommandLoad);
  }

  function onCommandLoad(err, commands) {
    if(err) return cb(err);
    this.execs = commands;
    this.emit('ready', this.execs);

    // inject command list so the script manager
    // can detect write commands
    ScriptManager.commands = commands;

    // loading from rdb files breaks the tests
    if(process.env.NODE_ENV === Constants.TEST) {
      return cb();
    }
    Persistence.load(this.state.store, this.state.conf, onDatabaseLoad);
  }

  function onDatabaseLoad(err, time, diff, version) {
    // load errors are thrown, will cause
    // the process to exit
    if(err) throw err;
    if(err !== false) {
      this.log.notice('db loaded from disk: %s seconds (v%s)', time, version);
      this.emit('database', time, diff, version);
    }
    cb();
  }

  onConfigLoad = onConfigLoad.bind(this);
  onCommandLoad = onCommandLoad.bind(this);
  onDatabaseLoad = onDatabaseLoad.bind(this);

  // load config
  this.conf.load(opts, onConfigLoad);
}