@Test public void testPrintHelp() throws IOException { final String APP_NAME = "myAppName"; File tf = File.createTempFile("printTestFile", ".txt"); try (PrintStream ps = new PrintStream(tf); BufferedReader br = new BufferedReader(new FileReader(tf))) { defaultFactory.printHelp(ps, APP_NAME); assertTrue(br.readLine().contains(APP_NAME)); } }
public static void printHelp(PrintStream stream, String app) { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(new PrintWriter(stream, true), formatter.getWidth(), app, HELP_HEADER, OPTIONS, formatter.getLeftPadding(), formatter.getDescPadding(), HELP_FOOTER, true); }
ToolConfig { public static void printHelp(PrintStream stream, String app) { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(new PrintWriter(stream, true), formatter.getWidth(), app, HELP_HEADER, OPTIONS, formatter.getLeftPadding(), formatter.getDescPadding(), HELP_FOOTER, true); } }
ToolConfig { public static void printHelp(PrintStream stream, String app) { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(new PrintWriter(stream, true), formatter.getWidth(), app, HELP_HEADER, OPTIONS, formatter.getLeftPadding(), formatter.getDescPadding(), HELP_FOOTER, true); } ToolConfig(CommandLine cli);  ToolConfig(Path target, boolean batch); }
ToolConfig { public static void printHelp(PrintStream stream, String app) { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(new PrintWriter(stream, true), formatter.getWidth(), app, HELP_HEADER, OPTIONS, formatter.getLeftPadding(), formatter.getDescPadding(), HELP_FOOTER, true); } ToolConfig(CommandLine cli);  ToolConfig(Path target, boolean batch); Path getTarget(); boolean isBatch(); static ToolConfig parse(String[] args); static void printHelp(PrintStream stream, String app); }
ToolConfig { public static void printHelp(PrintStream stream, String app) { HelpFormatter formatter = new HelpFormatter(); formatter.printHelp(new PrintWriter(stream, true), formatter.getWidth(), app, HELP_HEADER, OPTIONS, formatter.getLeftPadding(), formatter.getDescPadding(), HELP_FOOTER, true); } ToolConfig(CommandLine cli);  ToolConfig(Path target, boolean batch); Path getTarget(); boolean isBatch(); static ToolConfig parse(String[] args); static void printHelp(PrintStream stream, String app);  }