Java 类io.vertx.core.cli.CommandLine 实例源码

项目:vertx-shell    文件:Examples.java   
public void cliCommand() {
  CLI cli = CLI.create("my-command").
      addArgument(new Argument().setArgName("my-arg")).
      addOption(new Option().setShortName("m").setLongName("my-option"));
  CommandBuilder command = CommandBuilder.command(cli);
  command.processHandler(process -> {

    CommandLine commandLine = process.commandLine();

    String argValue = commandLine.getArgumentValue(0);
    String optValue = commandLine.getOptionValue("my-option");
    process.write("The argument is " + argValue + " and the option is " + optValue);

    process.end();
  });
}
项目:vertx-shell    文件:CommandProcess.java   
/**
 * @return the command line object or null
 */
CommandLine commandLine();