Submit a command to the server.

@param command The CLI command
@return The DMR response as a ModelNode
@throws CommandFormatException
@throws IOException
504161
public synchronized ModelNode doCommand(String command) throws CommandFormatException, IOException {
        ModelNode request = cmdCtx.buildRequest(command);
        return execute(request, isSlowCommand(command)).getResponseNode();
    }
678896
public static void exec(final boolean wait, final String command, final String... parms)
            throws IOException
   {
      String[] commandTokens = parms == null ? new String[1] : new String[parms.length + 1];
      commandTokens[0] = command;

      if (commandTokens.length > 1)
      {
         System.arraycopy(parms, 0, commandTokens, 1, parms.length);
      }

      Runtime.getRuntime().exec(commandTokens, null);
   }
402116
public void executeOnDaemon(Runnable command) {

        int id = 0;
        final Runnable commandToRun = command;

        synchronized (this) {
            this.daemonId++;
            id = this.daemonId;
        }

        final String runId = name + " : DMN" + id; // d185137.2

        Thread t = (Thread) AccessController.doPrivileged(new PrivilegedAction()
        { // d185137.2
            public Object run()
        {
            // return new Thread(commandToRun); // d185137.2
            Thread temp = new Thread(commandToRun, runId); // d185137.2
            temp.setDaemon(true);
            return temp;
        }
        });
        t.start();
    }
754351
public String executeCommandOnServlet(String command) {
    try {
      return getCommandResponseAsString(command);
    } catch (IOException e) {
      if (e instanceof ConnectException) {
        throw new SeleniumException(e.getMessage(), e);
      }
      e.printStackTrace();
      throw new UnsupportedOperationException("Catch body broken: IOException from " + command +
          " -> " + e, e);
    }
  }
824783
private void voidCommand(final String command) throws IOException {
		synchronized (this.asyncMutex) {
			this.out.write(command + "\n");
			this.out.flush();
		}
	}
162268
@CommandDescList({
		@CommandDesc(longName = "bibliography",
				description = "generate a bibliography",
				command = BibliographyCommand.class),
		@CommandDesc(longName = "citation",
				description = "generate citations",
				command = CitationCommand.class),
		@CommandDesc(longName = "list",
				description = "display sorted list of available citation IDs",
				command = ListCommand.class),
		@CommandDesc(longName = "lint",
				description = "validate citation items",
				command = LintCommand.class),
		@CommandDesc(longName = "json",
				description = "convert input bibliography to JSON",
				command = JsonCommand.class),
		@CommandDesc(longName = "mendeley",
				description = "connect to Mendeley Web",
				command = MendeleyCommand.class),
		@CommandDesc(longName = "zotero",
				description = "connect to Zotero",
				command = ZoteroCommand.class),
		@CommandDesc(longName = "shell",
				description = "run citeproc-java in interactive mode",
				command = ShellCommand.class),
		@CommandDesc(longName = "help",
				description = "display help for a given command",
				command = HelpCommand.class)
	})
	public void setCommand(AbstractCSLToolCommand command) {
		if (command instanceof ProviderCommand) {
			this.command = new InputFileCommand((ProviderCommand)command);
		} else {
			this.command = command;
		}
	}
305494
private CharSequence documentCommand(String command) {
		MethodTarget methodTarget = commandRegistry.listCommands().get(command);
		if (methodTarget == null) {
			throw new IllegalArgumentException("Unknown command '" + command + "'");
		}

		AttributedStringBuilder result = new AttributedStringBuilder().append("\n\n");
		List<ParameterDescription> parameterDescriptions = getParameterDescriptions(methodTarget);

		// NAME
		documentCommandName(result, command, methodTarget.getHelp());

		// SYNOPSYS
		documentSynopsys(result, command, parameterDescriptions);

		// OPTIONS
		documentOptions(result, parameterDescriptions);

		// ALSO KNOWN AS
		documentAliases(result, command, methodTarget);

		// AVAILABILITY
		documentAvailability(result, methodTarget);

		result.append("\n");
		return result;
	}
905982
public static String execute(final boolean withResponse, final String... command)
		throws IOException
	{
		final List<String> commands = new ArrayList<>();
		commands.add("bash");
		commands.add("-c");
		commands.addAll(Arrays.asList(command));
		String response = "";

		final ProcessBuilder pb = new ProcessBuilder(commands);
		pb.redirectErrorStream(true);

		final Process shell = pb.start();

		if (withResponse)
		{
			try (InputStream shellIn = shell.getInputStream())
			{
				response = toString(shellIn);
			}
		}

		return response;
	}
1215850
@Override
    protected void doHandle(CommandContext ctx) throws CommandFormatException {
        String argsStr = ctx.getArgumentsString();
        if(argsStr == null) {
            throw new CommandFormatException("Missing the command or operation to translate to DMR.");
        }
        argsStr = clearCmd(argsStr);
        ModelNode n = ctx.buildRequest(argsStr);
        ctx.printDMR(n, compact.isPresent(ctx.getParsedCommandLine()));
    }
961124
public static KubernetesMessage request(KubernetesCommand<?> command) {
        KubernetesRequest request = new KubernetesRequest();
        request.setCommand(command.getName());

        for (Map.Entry<String, Object> entry : command.getParameters().entrySet()) {
            if (entry.getKey().equals(KubernetesMessageHeaders.NAME)) {
                request.setName(entry.getValue().toString());
            }

            if (entry.getKey().equals(KubernetesMessageHeaders.NAMESPACE)) {
                request.setNamespace(entry.getValue().toString());
            }

            if (entry.getKey().equals(KubernetesMessageHeaders.LABEL)) {
                request.setLabel(entry.getValue().toString());
            }
        }

        return new KubernetesMessage(request);
    }
338287
public static void run(String[] command) throws IOException, RDF4JException, TrustyUriException {
		String cmd = command[0];
		String[] cmdArgs = Arrays.copyOfRange(command, 1, command.length);
		if (cmd.equals("CheckFile")) {
			CheckFile.main(cmdArgs);
		} else if (cmd.equals("ProcessFile")) {
			ProcessFile.main(cmdArgs);
		} else if (cmd.equals("CheckLargeRdf")) {
			CheckLargeRdf.main(cmdArgs);
		} else if (cmd.equals("TransformRdf")) {
			TransformRdf.main(cmdArgs);
		} else if (cmd.equals("TransformLargeRdf")) {
			TransformLargeRdf.main(cmdArgs);
		} else if (cmd.equals("CheckSortedRdf")) {
			CheckSortedRdf.main(cmdArgs);
		} else {
			System.err.println("ERROR: Unrecognized command " + cmd);
			System.exit(1);
		}
	}
737704
function send_command(command, cb) {
        var cmd = commands[command.toUpperCase()];
        if(parseInt(cmd)) {
            post('/roap/api/command', `<?xml version='1.0' encoding='utf-8'?><command><name>HandleKeyInput</name><value>${cmd}</value></command>`, (body) => {
                try {
                    var doc = new dom().parseFromString(body);
                    if(cb) cb(xpath.select('//ROAPErrorDetail/text()', doc).toString() == 'OK')
                } catch(error) {
                    log(`error send_command:  ${error.message}`)
                    if(cb) cb(false)
                }
            });
        }
    }
254514
public static String runDemonShellCommand( Session session, String command ) throws JSchException, IOException {
        String remoteResponseStr = launchACommandAndExit(session, command);
        return remoteResponseStr;
    }
233457
private synchronized void submit(final String command) {
    LOG.log(Level.INFO, "Submit command {0} to {1} evaluators. state: {2}",
        new Object[]{command, this.contexts.size(), this.state});
    assert this.state == State.READY;
    this.expectCount = this.contexts.size();
    this.state = State.WAIT_TASKS;
    this.cmd = null;
    for (final ActiveContext context : this.contexts.values()) {
      this.submit(context, command);
    }
  }
87276
public void sendCommand(MenuCommand command) {
        lastTx.set(clock.millis());
        try {
            connector.sendMenuCommand(command);
        } catch (IOException e) {
            logger.log(ERROR, "Error while writing out command", e);
            connector.close();
        }
    }
583509
public Response execute(Command command) throws IOException {
        for (EventListener temp : listeners) {
            temp.beforeEvent(command);
        }
        Response res = commandExecutor.execute(command);

        for (EventListener temp : listeners) {
            temp.afterEvent(command);
        }

        return res;
    }
347652
private Serializable executeCommand(RemoteCommand command, Serializable... args) throws RPCException
   {
      try
      {
         return command.execute(args);
      }
      catch (Throwable e)//NOSONAR
      {
         throw new RPCException(e.getMessage(), e);
      }
   }