@CommandDefinition(name = "rebase", description = "description of rebase command") public static class Rebase implements Command { @Option private boolean bar; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { commandInvocation.getShell().writeln("bar is set to: "+bar); return CommandResult.SUCCESS; } } }
@CommandDefinition(name = "test", description = "a simple test2") public class ParseCompleteTest2<CI extends CommandInvocation> extends TestCommand<CI> { @Option(shortName = 'X', description = "enable X") private String X; @Option(shortName = 'f', name = "foo", description = "enable foo") private String foo; @Option(shortName = 'e', name = "equal", description = "enable equal", required = true, defaultValue = "false") private Boolean equal; @Option(shortName = 'D', description = "define properties", required = true) private String define; }
@CommandDefinition(name = "test", description = "more [options] file...") public class Test3<CI extends CommandInvocation> implements Command<CI> { @Option(shortName = 't', name = "target", description = "target directory") private String target; @Option(shortName = 'e', description = "test run") private String test; @Override public CommandResult execute(CI commandInvocation) throws CommandException, InterruptedException { return CommandResult.SUCCESS; } } }
@CommandDefinition(name = "val", description = "") private static class ValCommand implements Command { @Option(activator = FooOptionActivator.class) private String foo; @Option private String bar; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return null; } }
@CommandDefinition(name = "test", description = "") public static class CommandTest6 implements Command { @Option(hasValue = false) private boolean bar; @Option(hasValue = false) private boolean barbar; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return CommandResult.SUCCESS; } }
@CommandDefinition(name = "arquillian-container-configuration", description = "") public static class ArqCommand implements Command { @Option(required = true) private String container; @Option(required = true, activator = ContainerActivator.class, completer = ContainerOptionCompleter.class) private String containerOption; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return null; } }
@CommandDefinition(name = "val2", description = "") public static class Val2Command implements Command { @Option(validator = NoUpperCaseValidator.class) private String foo; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { commandInvocation.println("VAL2"); return CommandResult.SUCCESS; } }
@GroupCommandDefinition(name = "super", description = "", groupCommands = {GitCommand.class}) public static class SuperGitCommand implements Command { @Option(hasValue = false) private boolean help; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return CommandResult.SUCCESS; } }
@CommandDefinition(name = "commit", description = "") public static class GitCommit implements Command { @Option(shortName = 'a', hasValue = false) private boolean all; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return CommandResult.SUCCESS; } }
@GroupCommandDefinition(name = "group", description = "", groupCommands = {ChildTest1.class, ChildTest2.class}) public class GroupCommandTest<CI extends CommandInvocation> extends TestingCommand<CI> { @Option(hasValue = false) private boolean help; }
@CommandDefinition(name = "convert", description = "") public static class ConCommand implements Command { @Option(name = "foo", converter = FooConverter.class) private String foo; public ConCommand() { } @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { commandInvocation.println(foo); return CommandResult.SUCCESS; } }
@GroupCommandDefinition(name = "group", description = "", groupCommands = {Command3.class}) public class GroupCommand1 implements Command { @Option private boolean help; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return CommandResult.SUCCESS; } }
@CommandDefinition(name = "bar", description = "") public static class BarCommand implements Command { @Option(completer = FooCompletor.class) private String bar; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return CommandResult.SUCCESS; } }
@CommandDefinition(name ="bar", description = "") private static class BarCommand implements Command { @Option private String info; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { assertEquals("yup", info); counter++; return CommandResult.SUCCESS; } }
@GroupCommandDefinition(name = "sub", description = "", groupCommands = {ChildTest1.class, ChildTest2.class}) public class SubSuperGroupCommandTest extends TestingCommand { @Option(hasValue = false) private boolean help; }
@CommandDefinition(name = "test", description = "") public static class CommandTest10 implements Command { @Option private String bar; @Argument private String arg; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return CommandResult.SUCCESS; } }
@CommandDefinition(name = "test", description = "") public static class ValidatorOptionCommand implements Command { @Option(required = true) private String foo; @Argument private String arg; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return CommandResult.SUCCESS; } }
@CommandDefinition(name = "test", description = "") public static class CommandTest9 implements Command { @Option(name = "foo\\ bar", completer = FooBarCompleter.class) private String bar; @Argument private String arg; @Override public CommandResult execute(CommandInvocation commandInvocation) throws CommandException, InterruptedException { return CommandResult.SUCCESS; } }
@CommandDefinition(name = "test", description = "a simple test4") public class ParseSpaceTest<CI extends CommandInvocation> extends TestCommand<CI> { @Option(shortName = 'r', activator = Test4Activator.class) private String required; @Argument(completer = SpaceArgumentCompleter.class) private String arg; }