@Group(name = "singleGroup", description = "a single group", defaultCommand = CommandWithGroupAnnotation.class,commands = {CommandAdd.class}) @Command(name = "commandWithGroup", description = "A command with a group annotation") public class CommandWithGroupAnnotation extends AbstractGroupAnnotationCommand { }
@Group(name = "singleGroup subGroup", description = "a single sub-group", defaultCommand = CommandWithSubGroupAnnotation.class,commands = {CommandAdd.class}) @Command(name = "commandWithGroup", description = "A command with a group annotation") public class CommandWithSubGroupAnnotation extends AbstractGroupAnnotationCommand { }
@com.github.rvesse.airline.annotations.Cli(name = "test", groups = { @Group(name = "foo bar", defaultCommand = Help.class, commands = { Help.class }) }) private static class SubGroupsCli01 { }
@Groups({ @Group(name = "groupInsideOfGroups subGroup", description = "my nested sub-group", defaultCommand = CommandWithSubGroupsAnnotation.class,commands = {CommandAdd.class}), @Group(name = "groupInsideOfGroups", description = "top level group", commands = { CommandWithSubGroupsAnnotation.class }) }) @Command(name = "commandWithSubGroupsAnno", description = "A command with a groups annotation defining a sub-group") public class CommandWithSubGroupsAnnotation extends AbstractGroupAnnotationCommand { @Option(name = "-v", type = OptionType.GROUP) public boolean verbose = false; }
@Cli(name = "git", description = "the stupid content tracker", defaultCommand = Help.class, commands = { Help.class, Add.class }, groups = { @Group(name = "remote", description = "Manage set of tracked repositories", defaultCommand = RemoteShow.class, commands = { RemoteShow.class, RemoteAdd.class }) } ) //@formatter:on public class GitWithCliAnnotation extends Git { public static void run(String[] args) { com.github.rvesse.airline.Cli<Runnable> gitParser = new com.github.rvesse.airline.Cli<Runnable>( GitWithCliAnnotation.class); gitParser.parse(args).run(); } }
}, groups = { @Group(name = "agent", description = "Manage agents", defaultCommand = AgentShowCommand.class,
@Groups({ @Group(name = "groupInsideOfGroups", description = "my nested group", defaultCommand = CommandWithGroupsAnnotation.class,commands = {CommandAdd.class}) }) @Command(name = "commandWithGroupsAnno", description = "A command with a groups annotation") public class CommandWithGroupsAnnotation extends AbstractGroupAnnotationCommand { @Option(name = "-v", type = OptionType.GROUP) public boolean verbose = false; }
@Cli(name = "git", description = "the stupid content tracker", defaultCommand = Help.class, commands = { Help.class, Add.class }, groups = { @Group(name = "remote", description = "Manage set of tracked repositories", defaultCommand = RemoteShow.class, commands = { RemoteShow.class, RemoteAdd.class }) }, parserConfiguration = @Parser( aliases = { @Alias( name = "foo", arguments = { "remote", "show" } ) }) ) //@formatter:on public class GitWithCliAnnotation2 extends Git { public static void run(String[] args) { com.github.rvesse.airline.Cli<Runnable> gitParser = new com.github.rvesse.airline.Cli<Runnable>( GitWithCliAnnotation2.class); gitParser.parse(args).run(); } }