/** * Returns the command usage, shortcut for invoking <code>getDescription().getUsage()</code> on this * object. * * @return the command usage */ public final String getUsage() { return description != null ? description.getUsage() : ""; }
public final String getUsage() { return description != null ? description.getUsage() : ""; }
/** * Returns the command usage, shortcut for invoking <code>getDescription().getUsage()</code> on this * object. * * @return the command usage */ public final String getUsage() { return description != null ? description.getUsage() : ""; } }
/** * Returns the command usage, shortcut for invoking <code>getDescription().getUsage()</code> on this * object. * * @return the command usage */ public final String getUsage() { return description != null ? description.getUsage() : ""; }
public final String getUsage() { return description != null ? description.getUsage() : ""; }
public final String getUsage() { return description != null ? description.getUsage() : ""; }
public void testClassDescription() throws Exception { @Usage("class_usage") @Man("class_man") class A { } CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class); assertEquals("class_usage", c.getUsage()); assertEquals("class_usage", c.getDescription().getUsage()); assertEquals("class_man", c.getDescription().getMan()); }
public void testMethodDescription() throws Exception { class A { @Usage("method_usage") @Man("method_man") @Command void m() {} } CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class); CommandDescriptor<Instance<A>> m = c.getSubordinate("m"); assertEquals("method_usage", m.getUsage()); assertEquals("method_usage", m.getDescription().getUsage()); assertEquals("method_man", m.getDescription().getMan()); }
public void testParameterMetaDescription1() throws Exception { class A { @Command void m(@Foo String s) {} } CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class); CommandDescriptor<Instance<A>> m = c.getSubordinate("m"); OptionDescriptor a = m.getOption("-a"); assertEquals("foo_usage", a.getUsage()); assertEquals("foo_usage", a.getDescription().getUsage()); assertEquals("foo_man", a.getDescription().getMan()); }
public void testParameterMetaDescription3() throws Exception { class A { @Command void m( @Usage("option_usage") @Foo String s) {} } CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class); CommandDescriptor<Instance<A>> m = c.getSubordinate("m"); OptionDescriptor a = m.getOption("-a"); assertEquals("option_usage", a.getUsage()); assertEquals("option_usage", a.getDescription().getUsage()); assertEquals("foo_man", a.getDescription().getMan()); } }
public void testParameterDescription() throws Exception { class A { @Command void m( @Usage("option_usage") @Man("option_man") @Option(names = "a") String s) {} } CommandDescriptor<Instance<A>> c = CommandFactory.DEFAULT.create(A.class); CommandDescriptor<Instance<A>> m = c.getSubordinate("m"); OptionDescriptor a = m.getOption("-a"); assertEquals("option_usage", a.getUsage()); assertEquals("option_usage", a.getDescription().getUsage()); assertEquals("option_man", a.getDescription().getMan()); }