Return the CommandLine for this script.
If there isn't one already, then create it using {@link #createCommandLine()}.

@return the CommandLine for this script.
495215
protected CommandLine getOrCreateCommandLine() {
        try {
            CommandLine commandLine = (CommandLine) getProperty(COMMAND_LINE);
            if (commandLine == null) {
                commandLine = createCommandLine();
                // The script has a real property (a field or getter) but if we let Script.setProperty handle
                // this then it just gets stuffed into a binding that shadows the property.
                // This is somewhat related to other bugged behavior in Script wrt properties and bindings.
                // See http://jira.codehaus.org/browse/GROOVY-6582 for example.
                // The correct behavior for Script.setProperty would be to check whether
                // the property has a setter before creating a new script binding.
                this.getMetaClass().setProperty(this, COMMAND_LINE, commandLine);
            }
            return commandLine;
        } catch (MissingPropertyException mpe) {
            CommandLine commandLine = createCommandLine();
            // Since no property or binding already exists, we can use plain old setProperty here.
            setProperty(COMMAND_LINE, commandLine);
            return commandLine;
        }
    }
804969
private static CommandLine createCommandLine(DeploymentEntry deployment, Options commandLineOptions) {
		try {
			return deployment.getCommandLine(commandLineOptions);
		} catch (Exception e) {
			throw new SqlExecutionException("Invalid deployment options.", e);
		}
	}
208588
public alluxio.grpc.MetaCommand getCommand() {
    alluxio.grpc.MetaCommand result = alluxio.grpc.MetaCommand.valueOf(command_);
    return result == null ? alluxio.grpc.MetaCommand.MetaCommand_Unknown : result;
  }
236180
public List<AbstractCommand> getCommands()
    {
        return commands.values().stream()
                        .map(id -> AbstractCommand.search(id))
                        .collect(Collectors.toList());
    }
889273
@SuppressWarnings("static-access")
    private Options createCommandLineOptions() {
        final Options options = new Options();
        addStandardOptions(options);
        addAdvancedOptions(options);
        addDeprecatedOptions(options);
        return options;
    }
402971
private Logger createLogger() {
    String loggerName = String.format("%s.%s.Script", project.getGroupId(), project.getArtifactId());
    return LoggerFactory.getLogger(loggerName);
  }
517227
public String build() {
        StringBuilder scriptBuilder = new StringBuilder();
        StringBuilder scriptBody = new StringBuilder();
        String importStmt = "import ";
        
        try {
            if (scriptCode.contains(importStmt)) {
                BufferedReader reader = new BufferedReader(new StringReader(scriptCode));
                String line;
                while ((line = reader.readLine()) != null) {
                    if (line.trim().startsWith(importStmt)) {
                        scriptBuilder.append(line);
                        scriptBuilder.append("\n");
                    } else {
                        scriptBody.append((scriptBody.length() == 0 ? "" : "\n"));
                        scriptBody.append(line);
                    }
                }
            } else {
                scriptBody.append(scriptCode);
            }
        } catch (IOException e) {
            throw new CitrusRuntimeException("Failed to construct script from template", e);
        }
        
        scriptBuilder.append(scriptHead);
        scriptBuilder.append(scriptBody.toString());
        scriptBuilder.append(scriptTail);
        
        return scriptBuilder.toString();
    }
762920
String[] getCommandLine() {
        List<String> args = new ArrayList<>();
        if (executable != null) {
            args.add(executable);
        }
        for (int i = 0; i < arguments.size(); i++) {
            CommandArgument argument = arguments.get(i);
            args.add(argument.forCommandLine());
        }
        return args.toArray(new String[args.size()]);
    }
880241
public String getMessage()
    {
        String trace;
        if ( node != null )
            trace = " : at Line: "+ node.getLineNumber()
                + " : in file: "+ node.getSourceFile()
                + " : "+node.getText();
        else
            // Users should not normally see this.
            trace = ": <at unknown location>";

        if ( callstack != null )
            trace = trace +"\n" + getScriptStackTrace();

        return getRawMessage() + trace;
    }
1255104
private <T extends CommandType> T getCommand() {
        if (command == null) {
            if (getPayload() instanceof String) {
                this.command = (T) marshaller.unmarshal(new StringSource(getPayload(String.class)));
            }
        }

        return (T) command;
    }
365736
private void determineCommand() {
        command = null;
        commandStr = null;

        boolean tooManyCommands = false;
        for (Command c : Command.values()) {
            final String alias = c.getAlias();
            if (hasOption(alias)) {
                if (c == Command.HELP) {
                    // `--help` can be a command or just a long option for another command.
                    help = true;
                } else if (command == null) {
                    // Found a command option
                    command = c;
                    commandStr = alias;
                } else {
                    tooManyCommands = true;
                }
            }
        }

        if (tooManyCommands) {
            command = null;
            commandStr = null;

            if (!help) {
                reportable.error(format(
                        "You must specify only one command (%s).%n",
                        showCommandAliases()));
                printHelp(true);
            }
        }
        if (help && command == null) {
            // `--help` is considered as the command if no other command is provided.
            command = Command.HELP;
            commandStr = command.getAlias();

        } else if (command == null) {
        	// Print usage if no commands were specified
        	printUsage();
        	reportable.error("\n");
            reportable
                    .error("No command option given. Please specify one of:  "
                            + showCommandAliases());
            end();
        }
    }
984877
@Override
    public ISUPMessage createCommand(int commandCode, int cic) {
        ISUPMessage msg = createCommand(commandCode);
        CircuitIdentificationCode code = this.parameterFactory.createCircuitIdentificationCode();
        code.setCIC(cic);
        msg.setCircuitIdentificationCode(code);
        return msg;
    }
539389
def _get_base_command(self):
        
        cd_command = ''.join(['cd ', str(self.WorkingDir), ';'])
        jvm_command = "java"
        jvm_arguments = self._commandline_join(
            [self.Parameters[k] for k in self._jvm_parameters])
        jar_arguments = '-jar "%s"' % self._get_jar_fp()
        rdp_arguments = self._commandline_join(
            [self.Parameters[k] for k in self._options])

        command_parts = [
            cd_command, jvm_command, jvm_arguments, jar_arguments,
            rdp_arguments, '-q']
        return self._commandline_join(command_parts).strip()
3182
CommandLine getCommandLine() {
        if (getWorkingDirectory() == null) {
            if (commonsExecCommandLine.isFile()) {
                File exec = new File(commonsExecCommandLine.getExecutable());
                File dir = exec.getParentFile();
                if (dir == null) {
                    throw new IllegalStateException(
                            "directory MUST be set (and could not be auto-determined from executable, although it was a File)");
                }
                this.setWorkingDirectory(dir);
                // DO NOT } else {
                // throw new
                // IllegalStateException("directory MUST be set (and could not be auto-determined from executable)");
            }
        }
        return commonsExecCommandLine;
    }
409057
public CommandLine getCommandLine(Options commandLineOptions) throws Exception {
		final List<String> args = new ArrayList<>();

		properties.asMap().forEach((k, v) -> {
			// only add supported options
			if (commandLineOptions.hasOption(k)) {
				final Option o = commandLineOptions.getOption(k);
				final String argument = "--" + o.getLongOpt();
				// options without args
				if (!o.hasArg()) {
					final Boolean flag = Boolean.parseBoolean(v);
					// add key only
					if (flag) {
						args.add(argument);
					}
				}
				// add key and value
				else if (!o.hasArgs()) {
					args.add(argument);
					args.add(v);
				}
				// options with multiple args are not supported yet
				else {
					throw new IllegalArgumentException("Option '" + o + "' is not supported yet.");
				}
			}
		});

		return CliFrontendParser.parse(commandLineOptions, args.toArray(new String[args.size()]), true);
	}
442131
protected static String runCommand (String cmd)
    {
        try {
            Process p = Runtime.getRuntime().exec(cmd);
            BufferedReader cin = new BufferedReader(new InputStreamReader(p.getInputStream()));
            StringBuilder buffer= new StringBuilder();

            String line = "";
            while (line != null)
            {
                buffer.append(line);
                line = cin.readLine();
            }
            cin.close();

            return buffer.toString();
        } catch (IOException e) {
            // don't want to log anything for the client to know what we are doing.
            // This will almost always be thrown/caught when the cmd isn't there.
            return null;
        }
    }
1364988
@Nonnull
    public String getCommandName() {
        String c = commandName;
        if (c != null)
            return c;
        return getArchitecture().getCommand();
    }