public <C> void assertPreserveHelpInSubCommand2(Class<C> clazz, C instance, String option) throws Exception { CommandDescriptor<Instance<C>> desc = HelpDescriptor.create(CommandFactory.DEFAULT.create(clazz)); InvocationMatcher<Instance<C>> matcher = desc.matcher(); InvocationMatch<Instance<C>> match = matcher. options(Collections.<String, List<?>>singletonMap(option, Collections.singletonList(Boolean.TRUE))).arguments(Collections.emptyList()). subordinate("sub"); CommandInvoker<Instance<C>, ?> invoker = match.getInvoker(); Object ret = invoker.invoke(Util.wrap(instance)); assertEquals("my help " + true, ret); } }
current = current.subordinate(((Event.Subordinate)event).getDescriptor().getName()); } else if (event instanceof Event.Argument) { Event.Argument argumentEvent = (Event.Argument)event;
InvocationMatch<T> sub = current.subordinate(mainName); if (sub != null) { current = sub; current = current.subordinate(((Event.Subordinate)event).getDescriptor().getName()); } else if (event instanceof Event.Argument) { Event.Argument argumentEvent = (Event.Argument)event;
current = current.subordinate(((Event.Subordinate)event).getDescriptor().getName()); } else if (event instanceof Event.Argument) { Event.Argument argumentEvent = (Event.Argument)event;