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(); }); }
/** * @return the command line object or null */ CommandLine commandLine();