/* runs the given command based on the name
760740
function runCommand(commandName,options){
      /* set prompt options */
      _prompts[commandName] = {
        name:commandName,
        message: options.prompt.message,
        type: (options.prompt.type !== undefined ? options.prompt.type : 'input'),
      }

      /* if type is list set choices option for prompt */
      if(options.prompt.type === 'list'){
        _prompts[commandName].choices = (typeof options.prompt.choices === 'function' ? options.prompt.choices(_values) : options.prompt.choices);
      }
      /* Run gulp prompt command */
      _gulp = _gulp.pipe(prompt.prompt(_prompts[commandName],method(commandName,options)));
  }
1289208
def call(self, name, options=None, o=None):
        
        if options is None:
            options = []

        command = self.get_application().find(name)

        options = [('command', command.get_name())] + options

        return command.run(ListInput(options), o)
489232
def run_command(self, command_name, varargs):
        
        command_descriptor = self.get_command(command_name)
        return command_descriptor.run(*varargs)
52193
function (name, version) {
    if (!name || !_.isString(name)) {
      throw new Error('Please pass in a command name!');
    }

    for (var a in this.aggregates) {
      var aggr = this.aggregates[a];
      var cmd = aggr.getCommand(name, version);
      if (cmd) {
        return aggr;
      }
    }

    for (var a in this.aggregates) {
      var aggr = this.aggregates[a];
      var cmdHndl = aggr.getCommandHandler(name, version);
      if (cmdHndl && cmdHndl !== aggr.defaultCommandHandler) {
        return aggr;
      }
    }

    debug('no matching aggregate found for command ' + name);

    return null;
  }
319881
public static void runShellCommand(String cmd,
                                     StringBuilder outputLines,
                                     StringBuilder errorLines)
    throws IOException {
    runShellCommand(new String[] {cmd}, outputLines, errorLines);
  }
700030
def __execute_cmd(name, cmd):
    '''
    
    '''
    return __salt__['cmd.run_all'](
        '{0} {1}'.format(salt.utils.path.which(name), cmd)
    )
772391
function runCmd(cmd, args, fn) {
    args = args || [];
    let runner = require('child_process').spawn(cmd, args, {
        // keep color
        stdio: 'inherit',
    });
    runner.on('close', function(code) {
        if (fn) {
            fn(code);
        }
    });
}
1252463
def run(self, command):
        
        if isinstance(command, basestring):
            command = command.split()
        else:
            command = list(command)
        self.external.omero_cli(command)
254514
public static String runDemonShellCommand( Session session, String command ) throws JSchException, IOException {
        String remoteResponseStr = launchACommandAndExit(session, command);
        return remoteResponseStr;
    }
1012957
function run(cmd){

        var proc = require('child_process'),
            done = grunt.task.current.async(); // Tells Grunt that an async task is complete

        proc.exec(cmd,
            function(error, stdout, stderr){
                if(stderr){
                    grunt.log.writeln('ERROR: ' + stderr).error();
                }
                grunt.log.writeln(stdout);
                done(error);
            }
        );
    }
14005
function runCommand(cmd) {
  return exec(cmd).catch(err =>
    Promise.reject(
      err.message && err.message.indexOf('not found') !== -1
        ? new Error(`${cmd.split(' ')[0]} must be installed to upload`)
        : err
    )
  )
}
1356671
def run_active_command
      require_valid_command
      if alias? command_name_from_args
        active_command.run(*(@aliases[command_name_from_args.to_s] + args_without_command_name))
      else
        active_command.run(*args_without_command_name)
      end
    end
1090421
public RESTResponse runCommand(Command command)  {
        if (this.applicationName != null) {
            command.setApplicationName(this.applicationName);
        }
        if (this.storageService != null) {
            command.setStorageService(this.storageService);
        }       
        if (this.restMetadataJson != null) {
            command.setRestMetadataJson(this.restMetadataJson);
        }
        command.validate(restClient);
        return command.call(restClient);        
    }
993183
def call_command(self, name, *arguments, **options):
        
        command, defaults = get_command_and_defaults(
            name,
            exclude_packages=self.get_exclude_packages(),
            exclude_command_class=self.__class__)
        if command is None:
            raise management.CommandError(
                "Unknown command: {name:s}".format(
                    name=name))
        defaults.update(options)
        return command.execute(*arguments, **defaults)
522740
public void runLocalCommand(String command) throws Exception {

        String result = "";
        String line;
        Process p;
        try {
            p = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", command});
            p.waitFor();
        } catch (java.io.IOException e) {
            this.commandExitStatus = 1;
            this.commandResult = "Error";
            return;
        }

        BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
        while ((line = input.readLine()) != null) {
            result += line;
        }

        input.close();
        this.commandResult = result;
        this.commandExitStatus = p.exitValue();

        p.destroy();

        if (p.isAlive()) {
            p.destroyForcibly();
        }

    }
307679
def do_run(self,args):
        """"""
        parser = CommandArgumentParser("run")
        parser.add_argument('-R','--replace-key',dest='replaceKey',default=False,action='store_true',help="Replace the host's key. This is useful when AWS recycles an IP address you've seen before.")
        parser.add_argument('-Y','--keyscan',dest='keyscan',default=False,action='store_true',help="Perform a keyscan to avoid having to say 'yes' for a new host. Implies -R.")
        parser.add_argument('-ii','--ignore-host-key',dest='ignore-host-key',default=False,action='store_true',help='Ignore host key')
        parser.add_argument('-ne','--no-echo',dest='no-echo',default=False,action='store_true',help='Do not echo command')
        parser.add_argument(dest='command',nargs='+',help="Command to run on all hosts.") # consider adding a filter option later
        parser.add_argument('-v',dest='verbosity',default=0,action=VAction,nargs='?',help='Verbosity. The more instances, the more verbose');        
        parser.add_argument('-j',dest='jobs',type=int,default=1,help='Number of hosts to contact in parallel');
        parser.add_argument('-s',dest='skip',type=int,default=0,help='Skip this many hosts');
        parser.add_argument('-m',dest='macro',default=False,action='store_true',help='{command} is a series of macros to execute, not the actual command to run on the host');
        args = vars(parser.parse_args(args))

        replaceKey = args['replaceKey']
        keyscan = args['keyscan']
        verbosity = args['verbosity']
        jobs = args['jobs']
        skip = args['skip']
        ignoreHostKey = args['ignore-host-key']
        noEcho = args['no-echo']

        instances = self.scalingGroupDescription['AutoScalingGroups'][0]['Instances']
        instances = instances[skip:]
        # if replaceKey or keyscan:
        #     for instance in instances:
        #         stdplus.resetKnownHost(instance)

        if args['macro']:
            if len(args['command']) > 1:
                print("Only one macro may be specified with the -m switch.")
                return
            else:
                macro = args['command'][0]
                print("Macro:{}".format(macro))
                command = Config.config['ssh-macros'][macro]
        else:
            command = ' '.join(args['command'])
            
        Parallel(n_jobs=jobs)(
            delayed(ssh)(instance['InstanceId'],0,[],replaceKey,keyscan,False,verbosity,command,ignoreHostKey=ignoreHostKey,echoCommand=not noEcho,name="{}:{}: ".format(instance['index'],instance['InstanceId'])) for instance in instances
        )
1048838
function load (commandName) {
  var command;

  try {
    command = require("./cli/" + commandName);
  } catch (e) {
    debug("Error loading command", commandName, e);
    command = null;
  }

  return command;
}