cmdargv *must* have leading whitespace to prevent
        foo@bar from becoming cmdname foo with argv=[@bar]
504813
def cmdargv(self):
        '''
        
        '''

        argv = []
        while self.more():

            # cmdargv *requires* whitespace
            if not self.ignore(whitespace):
                break

            # if we hit a | or a } we're done
            if self.nextstr('|'):
                break

            if self.nextstr('}'):
                break

            if not self.nextstr('{'):
                valu = self.cmdvalu()
                argv.append(valu)
                continue

            start = self.offs
            self.subquery()

            text = self.text[start:self.offs]

            argv.append(text)

        return s_ast.Const(tuple(argv))
1053673
function argv(args) {
  var out = {directives: {}}
    , i = 0;

  /* istanbul ignore next: never use process.argv in tests */
  args = args || process.argv.slice(2);
  if(!args.length) return out;

  // read conf from stdin
  if(args[i] === STDIN) {
    out.stdin = true;
    i++;
  // conf should be first arg
  }else if(!PTN.test(args[i])) {
    out.file = args[i];
    i++;
  }

  function add(key, value) {
    if(!key || value === null) return;
    if(!out.directives[key]) {
      out.directives[key] = value;
    // handle repeated directives, create an array
    }else if(out.directives[key]
      && !Array.isArray(out.directives[key])){
      out.directives[key] = [out.directives[key]];
      out.directives[key].push(value)
    // append to existing array value
    }else{
      out.directives[key].push(value)
    }
  }

  function gobble(arg, key, value) {
    if(arg === undefined) return add(key, value);
    value = value || '';
    if(PTN.test(arg)) {
      key = arg.replace(PTN, '');
      // gobble up value arguments
      while((arg = args[i++]) !== undefined && !PTN.test(arg)) {
        if(value) value += ' ';
        value += arg;
      }
      if(PTN.test(arg)) i--;
      add(key, value);
      value = null;
    }else{
      if(value) value += ' ';
      value += arg;
    }
    gobble(args[i++], key, value);
  }
  gobble(args[i]);
  return out;
}
164436
function(command) {
        var patt = /("[^"]*")/,
            quotedStringPlaceholder = "__QUOTEDSTR__",
            escapedQuotePlaceholder = "__ESCAPED_QUOTE__",
            matches = [],
            match;

        command = command.replace(/\\\"/g, escapedQuotePlaceholder);

        while ((match = patt.exec(command))) {
            var matched = match[0];
            command =
                command.substr(0, match.index) + quotedStringPlaceholder + command.substr(match.index + matched.length);
            matches.push(matched.substring(1, matched.length - 1));
        }

        var parts = command.split(" ");
        parts = parts.map(function(part) {
            var item = part.trim();
            if (item === quotedStringPlaceholder) {
                item = matches.shift();
            }
            item = item.replace(new RegExp(escapedQuotePlaceholder, "g"), '"');
            return item;
        });

        return parts;
    }
453057
def cmd(send, msg, args):
    
    if args['type'] == 'privmsg':
        send('GCC is a group exercise!')
        return
    if 'include' in msg:
        send("We're not a terribly inclusive community around here.")
        return
    if 'import' in msg:
        send("I'll have you know that standards compliance is important.")
        return
    tmpfile = tempfile.NamedTemporaryFile()
    for line in msg.splitlines():
        line = line + '\n'
        tmpfile.write(line.encode())
    tmpfile.flush()
    process = subprocess.run(['gcc', '-o', '/dev/null', '-xc', tmpfile.name],
                             stdout=subprocess.PIPE,
                             stderr=subprocess.STDOUT,
                             timeout=5,
                             universal_newlines=True)
    tmpfile.close()
    # Take the last 3 lines to prevent Excess Flood on long error messages
    output = process.stdout.splitlines()[:3]
    for line in output:
        send(line, target=args['nick'])
    if process.returncode == 0:
        send(gen_slogan("gcc victory"))
    else:
        send(gen_slogan("gcc failed"))
21393
def split_command(cmd, posix=None):
    '''
     
    '''
    if not isinstance(cmd, string_types):
        # cmd is string list
        pass
    else:
        if not PY3:
            # cmd is string
            # The shlex module currently does not support Unicode input (in
            # 2.x)!
            if isinstance(cmd, unicode):
                try:
                    cmd = unicodedata.normalize(
                        'NFKD', cmd).encode('ascii', 'strict')
                except UnicodeEncodeError:
                    raise EasyProcessUnicodeError('unicode command "%s" can not be processed.' % cmd +
                                                  'Use string list instead of string')
                log.debug('unicode is normalized')
        if posix is None:
            posix = 'win' not in sys.platform
        cmd = shlex.split(cmd, posix=posix)
    return cmd
542035
public void cmdProc(Interp interp, TclObject argv[])
    throws TclException {
        int currentObjIndex, len, i;
        int objc = argv.length - 1;
        boolean doBackslashes = true;
        boolean doCmds = true;
        boolean doVars = true;
        StringBuffer result = new StringBuffer();
        String s;
        char c;

        for (currentObjIndex = 1; currentObjIndex < objc; currentObjIndex++) {
            if (!argv[currentObjIndex].toString().startsWith("-")) {
                break;
            }
            int opt = TclIndex.get(interp, argv[currentObjIndex],
                            validCmds, "switch", 0);
            switch (opt) {
                case OPT_NOBACKSLASHES:
                    doBackslashes = false;
                    break;
                case OPT_NOCOMMANDS:
                    doCmds = false;
                    break;
                case OPT_NOVARS:
                    doVars = false;
                    break;
                default:
                    throw new TclException(interp,
                                    "SubstCrCmd.cmdProc: bad option " + opt
                                    + " index to cmds");
            }
        }
        if (currentObjIndex != objc) {
            throw new TclNumArgsException(interp, currentObjIndex, argv,
                            "?-nobackslashes? ?-nocommands? ?-novariables? string");
        }

        /*
         * Scan through the string one character at a time, performing
         * command, variable, and backslash substitutions.
         */

        s = argv[currentObjIndex].toString();
        len = s.length();
        i = 0;
        while (i < len) {
            c = s.charAt(i);

            if ((c == '[') && doCmds) {
                ParseResult res;
                try {
                    interp.evalFlags = Parser.TCL_BRACKET_TERM;
                    interp.eval(s.substring(i + 1, len));
                    TclObject interp_result = interp.getResult();
                    interp_result.preserve();
                    res = new ParseResult(interp_result,
                                    i + interp.termOffset);
                } catch (TclException e) {
                    i = e.errIndex + 1;
                    throw e;
                }
                i = res.nextIndex + 2;
                result.append( res.value.toString() );
                res.release();
                /**
                 * Removed
                 (ToDo) may not be portable on Mac
                } else if (c == '\r') {
                   i++;
                 */
            } else if ((c == '$') && doVars) {
                ParseResult vres = Parser.parseVar(interp,
                                s.substring(i, len));
                i += vres.nextIndex;
                result.append( vres.value.toString() );
                vres.release();
            } else if ((c == '\\') && doBackslashes) {
                BackSlashResult bs = Interp.backslash(s, i, len);
                i = bs.nextIndex;
                if (bs.isWordSep) {
                    break;
                } else {
                    result.append( bs.c );
                }
            } else {
                result.append( c );
                i++;
            }
        }

        interp.setResult(result.toString());
    }
499950
function Cli(argv) {
  var Cucumber = require('cucumber');
  var Command = require('commander').Command;
  var path = require('path');

  function collect(val, memo) {
    memo.push(val);
    return memo;
  }

  function getProgram() {
    var program = new Command(path.basename(argv[1]));

    program
      .usage('[options] [<DIR|FILE[:LINE]>...]')
      .version(Cucumber.VERSION, '-v, --version')
      .option('-b, --backtrace', 'show full backtrace for errors')
      .option('--compiler <EXTENSION:MODULE>', 'require files with the given EXTENSION after requiring MODULE (repeatable)', collect, [])
      .option('-d, --dry-run', 'invoke formatters without executing steps')
      .option('--fail-fast', 'abort the run on first failure')
      .option('-f, --format <TYPE[:PATH]>', 'specify the output format, optionally supply PATH to redirect formatter output (repeatable)', collect, ['pretty'])
      .option('--name <REGEXP>', 'only execute the scenarios with name matching the expression (repeatable)', collect, [])
      .option('--no-colors', 'disable colors in formatter output')
      .option('--no-snippets', 'hide step definition snippets for pending steps')
      .option('--no-source', 'hide source uris')
      .option('-p, --profile <NAME>', 'specify the profile to use (repeatable)', collect, [])
      .option('-r, --require <FILE|DIR>', 'require files before executing features (repeatable)', collect, [])
      .option('--snippet-syntax <FILE>', 'specify a custom snippet syntax')
      .option('-S, --strict', 'fail if there are any undefined or pending steps')
      .option('-t, --tags <EXPRESSION>', 'only execute the features or scenarios with tags matching the expression (repeatable)', collect, []);

    program.on('--help', function () {
      console.log('  For more details please visit https://github.com/cucumber/cucumber-js#cli\n');
    });

    return program;
  }

  function getConfiguration() {
    var program = getProgram();
    program.parse(argv);
    var profileArgs = Cucumber.Cli.ProfilesLoader.getArgs(program.profile);
    if (profileArgs.length > 0) {
      var fullArgs = argv.slice(0, 2).concat(profileArgs).concat(argv.slice(2));
      program = getProgram();
      program.parse(fullArgs);
    }
    var configuration = Cucumber.Cli.Configuration(program.opts(), program.args);
    return configuration;
  }

  var self = {
    run: function run(callback) {
      var configuration = getConfiguration();
      var runtime = Cucumber.Runtime(configuration);
      var formatters = [createIpcFormatter()].concat(configuration.getFormatters());
      formatters.forEach(function (formatter) {
        runtime.attachListener(formatter);
      });
      try {
        runtime.start(callback);
      } catch (e) {
        console.log(e.stack || e)
        callback(false)
      }
    }
  };
  return self;
}
198361
def cli(ctx, pattern, arguments, safe):
    """"""

    matches = utils.grep_commands(pattern)
    if matches:
        selected = utils.select_command(matches)
        if selected >= 0:
            cmd, desc = matches[selected]
            pcmd = utils.create_pcmd(cmd)
            raw_params, params, defaults = utils.get_params_in_pcmd(pcmd)

            arguments = list(arguments)
            kargs = {}
            for r, p, d in zip(raw_params, params, defaults):
                if arguments:
                    val = arguments.pop(0)
                    click.echo("{}: {}".format(p, val))
                    kargs[r] = val
                elif safe:
                    if d:
                        kargs[r] = d
                else:
                    p_default = d if d else None
                    val = click.prompt("Enter value for '{}'".format(p), default=p_default)
                    kargs[r] = val
            click.echo("\n")

            final_cmd = utils.substitute_pcmd(pcmd, kargs, safe)

            command = "$ {} :: {}".format(final_cmd, desc)
            if click.confirm("Execute\n\t{}\n\n?".format(command), default=True):
                os.system(final_cmd)
    elif matches == []:
        click.echo('No saved commands matches the pattern {}'.format(pattern))
    else:
        click.echo("No commands to run, Add one by 'keep new'. ")
508552
def commandfactory(cmdline, mode='global'):
    
    # split commandname and parameters
    if not cmdline:
        return None
    logging.debug('mode:%s got commandline "%s"', mode, cmdline)
    # allow to shellescape without a space after '!'
    if cmdline.startswith('!'):
        cmdline = 'shellescape \'%s\'' % cmdline[1:]
    cmdline = re.sub(r'"(.*)"', r'"\\"\1\\""', cmdline)
    try:
        args = split_commandstring(cmdline)
    except ValueError as e:
        raise CommandParseError(str(e))
    args = [string_decode(x, 'utf-8') for x in args]
    logging.debug('ARGS: %s', args)
    cmdname = args[0]
    args = args[1:]

    # unfold aliases
    # TODO: read from settingsmanager

    # get class, argparser and forced parameter
    (cmdclass, parser, forcedparms) = lookup_command(cmdname, mode)
    if cmdclass is None:
        msg = 'unknown command: %s' % cmdname
        logging.debug(msg)
        raise CommandParseError(msg)

    parms = vars(parser.parse_args(args))
    parms.update(forcedparms)

    logging.debug('cmd parms %s', parms)

    # create Command
    cmd = cmdclass(**parms)

    # set pre and post command hooks
    get_hook = settings.get_hook
    cmd.prehook = get_hook('pre_%s_%s' % (mode, cmdname)) or \
        get_hook('pre_global_%s' % cmdname)
    cmd.posthook = get_hook('post_%s_%s' % (mode, cmdname)) or \
        get_hook('post_global_%s' % cmdname)

    return cmd
615912
def parse_conf_args(argv):
    """"""

    args = {}
    for rarg in argv:
        if re.match("^--.*", rarg):
            arg = rarg.replace('--','', 1)

            fsplit = arg.split('=', 1)
            if len(fsplit) != 2:
                raise Exception(
                    "Command option '%s' not recognized." % rarg)

            rkey, value = fsplit
            ssplit = rkey.split('.', 1)
            if len(ssplit) != 2 or not ssplit[1]:
                raise Exception(
                    "Command option '%s' not recognized." % rarg)

            section, option = ssplit
            args[section] = (option, value)
        else:
            raise Exception(
                    "Command option '%s' not recognized." % rarg)

    return args
1362934
def remove_whitespace(text_string):
    '''
    
    '''
    if text_string is None or text_string == "":
        return ""
    elif isinstance(text_string, str):
        return " ".join(text_string.split())
    else:
        raise InputError("none type or string not passed as an argument")
644357
def aug_sysargv(cmdstr):
    
    import shlex
    argv = shlex.split(cmdstr)
    sys.argv.extend(argv)
1238990
function parseGruntCommandLine() {
        var cmdline = _cmdline.match(/--[\S]+\b/ig);

        if (null != cmdline) {
            for (var i = 0, n = cmdline.length; i < n; i++) {
                // if cmdline does not have "=", set "true" as default value.
                if (!cmdline[i].match(/=/i)) {
                    cmdline[i] += '=true';
                }
            }
        } else {
            cmdline = [];
        }

        return cmdline;
    }
1104619
def do_gn(self, arg):
        
        if self.cmdprefix:
            raise CmdError("prefix not allowed")
        if arg:
            raise CmdError("too many arguments")
        if self.lastEvent:
            self.lastEvent.continueStatus = win32.DBG_EXCEPTION_NOT_HANDLED
        return self.do_go(arg)
563701
def parse_command(self, commandstr):
        

        if len(commandstr.split('|')) > 1:
            vals = []
            for cmd in commandstr.split('|'):
                vals.append(self.parse_command(cmd))
            return vals

        cmdlist = commandstr.strip().split(' ')
        command = None
        keys = {}
        opts = []

        for key in cmdlist:
            v = key.strip().split('=')
            if len(v) > 1:
                # Key
                if len(v) > 2:
                    # Fix the stupidities in TS3 escaping
                    v = [v[0], '='.join(v[1:])]
                key, value = v
                keys[key] = self._unescape_str(value)
            elif not v == ['']:
                if v[0][0] and v[0][0] == '-':
                    # Option
                    opts.append(v[0][1:])
                else:
                    command = v[0]

        d = {'keys': keys, 'opts': opts}
        if command:
            d['command'] = command
        return d
1080201
def _trim_whitespace(self, char):  # For loading text assets only
        

        psum = lambda x: sum(sum(x, []))
        if psum(char) > 0:
            is_empty = True
            while is_empty:  # From front
                row = char[0:8]
                is_empty = psum(row) == 0
                if is_empty:
                    del char[0:8]
            is_empty = True
            while is_empty:  # From back
                row = char[-8:]
                is_empty = psum(row) == 0
                if is_empty:
                    del char[-8:]
        return char
869705
def t_heredocvar_ENCAPSED_AND_WHITESPACE(t):
    '
    t.lexer.lineno += t.value.count("\n")
    t.lexer.pop_state()
    return t