.footer("This is the bottom") .header("This is the header") .commandLineSyntax("ctrl-alt-del") .build();
.commandLineSyntax("java -jar jarname.jar <options>") .header("RinSim Experiment command line interface.") .footer("For more information see http://github.com/rinde/RinSim")
.commandLineSyntax("java -jar jarname.jar <options>") .header("RinSim Experiment command line interface.") .footer("For more information see http://github.com/rinde/RinSim")
/** * Test for setting a custom help formatter. */ @Test public void testCustomHelpFormatter() { final HelpFormatter defaultFormatter = DefaultHelpFormatter.INSTANCE; final HelpFormatter customFormatter = new DummyHelpFormatter(); final Menu m = Menu.builder() .addHelpOption("h", "help", "help") .commandLineSyntax("") .helpFormatter(customFormatter) .build(); assertEquals(" -h,--help help\n", defaultFormatter.format(m)); assertEquals("[h, help]", customFormatter.format(m)); assertNotEquals(defaultFormatter.format(m), m.printHelp()); assertEquals(customFormatter.format(m), m.printHelp()); }