static class Issue439Command { @Mixin Issue439Mixin mixin; @Spec CommandSpec spec; @Option(names = "--raptor") void setRaptorFences(final String value) { throw new ParameterException(spec.commandLine(), "RAPTOR error"); } }
@Command static class AnnotatedClassWithMixinParameters { @Mixin SomeMixin mixin; @Command(name="sum") long sum(@Option(names = "-y") String[] y, @Mixin SomeMixin subMixin, int[] x) { return mixin.a + mixin.b + y.length + subMixin.a + subMixin.b + x.length; } }
@Command(name="sum") long sum(@Option(names = "-a") int a, @Mixin EmptyMixin mixin) { return a; } }
@Command(name="sum") long sum(@Option(names = "-y") String[] y, @Mixin SomeMixin subMixin, int[] x) { return mixin.a + mixin.b + y.length + subMixin.a + subMixin.b + x.length; } }
@Command(name="sum") long sum(@Option(names = "-y") String[] y, @Mixin SomeMixin subMixin, int[] x) { return y.length + subMixin.a + subMixin.b + x.length; } }
List<String> unmatched; @Mixin Object mixin;
CommandSpec spec; @Mixin ExampleMixin mixin;
@Command(name = "mixee", description = "This command has a footer and an option mixed in") public class CommandWithMixin { @Mixin CommonOption commonOption = new CommonOption(); @Option(names = "-y", description = "command option") int y; @Command public void doit(@Mixin CommonOption commonOptionParam, @Option(names = "-z") int z, @Parameters String arg0, String arg1) {} public static void main(String[] args) { CommandWithMixin cmd = new CommandWithMixin(); new CommandLine(cmd).parseArgs("-x", "3", "-y", "4"); System.out.printf("x=%s, y=%s%n", cmd.commonOption.x, cmd.y); } }
@Command void posAndMixin(int[] x, @Mixin SomeMixin mixin) { }
@Command void posAndOptAndMixin(int[] x, @Option(names = "-y") String[] y, @Mixin SomeMixin mixin) { }
@Command void withMixin(@Mixin SomeMixin mixin) { }
@Command(name="sum") long sum(@Option(names = "-y") String[] y, @Mixin SomeMixin subMixin, int[] x) { return mixin.a + mixin.b + y.length + subMixin.a + subMixin.b + x.length; } }
@Command(name="sum") long sum(@Option(names = "-y") String[] y, @Mixin SomeMixin subMixin, int[] x) { return y.length + subMixin.a + subMixin.b + x.length; } }
static class Issue439Command { @Mixin Issue439Mixin mixin; @Spec CommandSpec spec; @Option(names = "--raptor") void setRaptorFences(final String value) { throw new ParameterException(spec.commandLine(), "RAPTOR error"); } }
@Command static class AnnotatedClassWithMixinParameters { @Mixin SomeMixin mixin; @Command(name="sum") long sum(@Option(names = "-y") String[] y, @Mixin SomeMixin subMixin, int[] x) { return mixin.a + mixin.b + y.length + subMixin.a + subMixin.b + x.length; } }
@Command public void doit(@Mixin CommonOption commonOptionParam, @Option(names = "-z") int z, @Parameters String arg0, String arg1) {}
@Command(name="sum") long sum(@Option(names = "-a") int a, @Mixin EmptyMixin mixin) { return a; } }
@Command void mixinFirst(@Mixin SomeMixin mixin, int[] x, @Option(names = "-y") String[] y) { } }