Expects a command and 0 or more arguments like so:
command(argument1,argument2,argument3)

@param line Command line
@return String list, #0 is the command, the rest are arguments
498743
public static String[] disectCommandLine(String line) {
		return StringSupport.split(line, "() ,;", "\"", false, false, false).toArray(new String[0]);
	}
452200
static List<String> splitCommandLine(String commandLine) {
        // Split the commandLine by whitespace.
        // Allow escaping single and double quoted strings.
        if (Objects.requireNonNull(commandLine, "commandLine").isEmpty()) {
            return new LinkedList<>();
        }

        final List<String> elements = new ArrayList<>();
        final QuoteStack quoteStack = new QuoteStack();
        char c = commandLine.charAt(0);
        boolean matching = !isWhitespace(c);
        int matchStart = 0;
        if (isQuote(c)) {
            quoteStack.push(c);
            matchStart = 1;
        }
        for (int i = 1; i < commandLine.length(); i++) {
            c = commandLine.charAt(i);
            if (matching) {
                if (isWhitespace(c) && quoteStack.isEmpty()) {
                    // Detected a whitespace after matching, and we're not in a quote -
                    // this is a word boundary.
                    elements.add(commandLine.substring(matchStart, i));
                    matching = false;
                } else if (isQuote(c) && quoteStack.quoteMatches(c)) {
                    // Quote closes a previous section of quoted text.
                    elements.add(commandLine.substring(matchStart, i));
                    quoteStack.pop();
                    matching = false;
                }
            } else if (isQuote(c)) {
                // We're not matching - Quote opens a new section of quoted text.
                quoteStack.push(c);
                matchStart = i + 1;
                matching = true;
            } else if (!isWhitespace(c)) {
                // Done slurping whitespaces - non-whitespace detected, start matching.
                matching = true;
                matchStart = i;
            }
        }
        if (matching) {
            // Finished processing commandLine, but we're still matching - add the last word.
            elements.add(commandLine.substring(matchStart, commandLine.length()));
        }

        return elements;
    }
1150576
protected boolean processLine(final CommandLine line, final Options options)
            throws Exception {
        if (line.hasOption("version")) {
            System.out.println("version " + getVersion());
            return false;
        }
        if (line.hasOption("help")) {
            produceHelp(options);
            return false;
        }
        if (line.hasOption("config")) {
            setConfigFile(line.getOptionValue("config").trim());
        }
        if (line.hasOption("input")) {
            setInput(line.getOptionValue("input").trim());
        }
        if (line.hasOption("inputEncoding")) {
            setInputEncoding(line.getOptionValue("inputEncoding").trim());
        }
        if (line.hasOption("output")) {
            setOutput(line.getOptionValue("output").trim());
        }
        if (line.hasOption("targetNamespacePrefix")) {
            setTargetNamespacePrefix(line.getOptionValue(
                    "targetNamespacePrefix").trim());
        }
        if (line.hasOption("xsltFileName")) {
            setXsltFileName(line.getOptionValue(
                    "xsltFileName").trim());
        }

        return true;
    }
1316592
public static List<String> constructCommandAsList_Unix_sh (String command) {
		List<String> commandAsList = new ArrayList<String> ();

		commandAsList.add ("sh");
		commandAsList.add ("-c");
		commandAsList.add (command);

		return commandAsList;
	}
65177
protected String[] fetchCommandParams(CommandInterpreter interpreter) {
        List<String> result = new ArrayList<String>();
        String param;
        while ((param = interpreter.nextArgument()) != null) {
            result.add(param);
        }
        return result.toArray(new String[result.size()]);
    }
562904
def send_command_return_multilines(self, obj, command, *arguments):
        
        index_command = obj._build_index_command(command, *arguments)
        return self.chassis_list[obj.chassis].sendQuery(index_command, True)
932176
def command_lines():
        
        return ZeroOrMore(Group(
            Group(ZeroOrMore(Group(Grammar.comment))) + Grammar._non_comment_line
        ))
789042
@SuppressWarnings("checkstyle:regexp")
	public static void showCommandLineArguments(String[] args) {
		try (PrintStream os = getConsoleLogger()) {
			for (int i = 0; i < args.length; ++i) {
				os.println(i + ": " //$NON-NLS-1$
						+ args[i]);
			}
			os.flush();
		} catch (Throwable e) {
			e.printStackTrace();
		}
		getExiter().exit();
	}
396160
public static CommandLine forExecute(String rawCommandLine) {
        final List<String> elements = splitCommandLine(rawCommandLine);
        return new CommandLine(elements);
    }
745654
def onecmd(self, line):
        
        if not self.commands_defining:
            return cmd.Cmd.onecmd(self, line)
        else:
            return self.handle_command_def(line)
844234
def onecmd(self, line):
        
        if DEBUG:
            print('Executing "%s"' % line)
        self.line_num += 1
        if line == "EOF" or line == 'exit':
            if cmd.Cmd.use_rawinput:
                # This means that we printed a prompt, and we'll want to
                # print a newline to pretty things up for the caller.
                self.print('')
            return True
        # Strip comments
        comment_idx = line.find("#")
        if comment_idx >= 0:
            line = line[0:comment_idx]
            line = line.strip()

        # search multiple commands on the same line
        lexer = shlex.shlex(line)
        lexer.whitespace = ''

        for issemicolon, group in itertools.groupby(lexer, lambda x: x == ";"):
            if not issemicolon:
                self.onecmd_exec("".join(group))
1010771
protected int getStartArgNo(final ParsedLine line) {
		// コード補完する引数の番号を特定。
		if (line.wordIndex() >= 1) {
			return commands.stream().filter(c -> c.is(line.words().get(0)))
					.mapToInt(c -> c.getStartArgNo(this.getClass())).findFirst().orElse(-1);
		} else {
			return -1;
		}
	}
339365
function CommandLine(commands) {
  this.keys = Object.keys(commands);
  this.commands = commands;
  this.args = process.argv.slice(2);
  this.context = this.args[0] || null;
  this.help = {
    before: '',
    after: ''
  }
}
626098
private static String[] readArgsFile(String argsFile) throws IOException {
    final ArrayList<String> lines = new ArrayList<String>();
    final BufferedReader reader = new BufferedReader(
        new InputStreamReader(
            new FileInputStream(argsFile), "UTF-8"));
    try {
      String line;
      while ((line = reader.readLine()) != null) {
        line = line.trim();
        if (!line.isEmpty() && !line.startsWith("#")) {
          lines.add(line);
        }
      }
    } finally {
      reader.close();
    }
    return lines.toArray(new String [lines.size()]);
  }
832508
protected Commandline getCommandline() {
        Commandline cmdl = new Commandline();
        if (configFile != null) {
            cmdl.createArgument().setValue("--config");
            cmdl.createArgument().setFile(configFile);
        }
        if (debug) {
            cmdl.createArgument().setValue("--debug");
        }
        return cmdl;
    }
803920
public static String[] partitionCommandLine(final String command) {
    final ArrayList<String> commands = new ArrayList<>();

    int index = 0;

    StringBuffer buffer = new StringBuffer(command.length());

    boolean isApos = false;
    boolean isQuote = false;
    while (index < command.length()) {
      final char c = command.charAt(index);

      switch (c) {
        case ' ':
          if (!isQuote && !isApos) {
            final String arg = buffer.toString();
            buffer = new StringBuffer(command.length() - index);
            if (arg.length() > 0) {
              commands.add(arg);
            }
          } else {
            buffer.append(c);
          }
          break;
        case '\'':
          if (!isQuote) {
            isApos = !isApos;
          } else {
            buffer.append(c);
          }
          break;
        case '"':
          if (!isApos) {
            isQuote = !isQuote;
          } else {
            buffer.append(c);
          }
          break;
        default:
          buffer.append(c);
      }

      index++;
    }

    if (buffer.length() > 0) {
      final String arg = buffer.toString();
      commands.add(arg);
    }

    return commands.toArray(new String[commands.size()]);
  }
1056131
def getargtxt(obj, one_arg_per_line=True):
    
    args = getargs(obj)
    if args:
        sep = ', '
        textlist = None
        for i_arg, arg in enumerate(args):
            if textlist is None:
                textlist = ['']
            textlist[-1] += arg
            if i_arg < len(args)-1:
                textlist[-1] += sep
                if len(textlist[-1]) >= 32 or one_arg_per_line:
                    textlist.append('')
        if inspect.isclass(obj) or inspect.ismethod(obj):
            if len(textlist) == 1:
                return None
            if 'self'+sep in textlist:
                textlist.remove('self'+sep)
        return textlist