commandSpec.positionalParameters().size(), commandSpec.requiredArgs().size(), commandSpec .subcommands().size());} parsedCommands.add(CommandLine.this); List<ArgSpec> required = new ArrayList<ArgSpec>(commandSpec.requiredArgs()); Set<ArgSpec> initialized = new HashSet<ArgSpec>(); Collections.sort(required, new PositionalParametersSorter());
@Test public void testCommandSpec_forAnnotatedObjectLenient_returnsEmptyCommandSpec() { CommandSpec spec = CommandSpec.forAnnotatedObjectLenient(new Object()); assertTrue(spec.optionsMap().isEmpty()); assertTrue(spec.posixOptionsMap().isEmpty()); assertTrue(spec.options().isEmpty()); assertTrue(spec.positionalParameters().isEmpty()); assertTrue(spec.unmatchedArgsBindings().isEmpty()); assertTrue(spec.subcommands().isEmpty()); assertTrue(spec.mixins().isEmpty()); assertTrue(spec.requiredArgs().isEmpty()); assertFalse(spec.mixinStandardHelpOptions()); assertFalse(spec.helpCommand()); assertEquals("<main class>", spec.name()); assertArrayEquals(new String[0], spec.version()); assertNull(spec.versionProvider()); }
commandSpec.positionalParameters().size(), commandSpec.requiredArgs().size(), commandSpec .subcommands().size());} parsedCommands.add(CommandLine.this); List<ArgSpec> required = new ArrayList<ArgSpec>(commandSpec.requiredArgs()); Set<ArgSpec> initialized = new HashSet<ArgSpec>(); Collections.sort(required, new PositionalParametersSorter());
@Test public void testCommandSpec_forAnnotatedObjectLenient_returnsEmptyCommandSpec() { CommandSpec spec = CommandSpec.forAnnotatedObjectLenient(new Object()); assertTrue(spec.optionsMap().isEmpty()); assertTrue(spec.posixOptionsMap().isEmpty()); assertTrue(spec.options().isEmpty()); assertTrue(spec.positionalParameters().isEmpty()); assertTrue(spec.unmatchedArgsBindings().isEmpty()); assertTrue(spec.subcommands().isEmpty()); assertTrue(spec.mixins().isEmpty()); assertTrue(spec.requiredArgs().isEmpty()); assertFalse(spec.mixinStandardHelpOptions()); assertFalse(spec.helpCommand()); assertEquals("<main class>", spec.name()); assertArrayEquals(new String[0], spec.version()); assertNull(spec.versionProvider()); }