From 7a5654489359fa3bedfd300dd478af13c421e1a4 Mon Sep 17 00:00:00 2001 From: takahi-i Date: Sun, 25 Mar 2018 23:29:53 +0900 Subject: [PATCH] Enrich help message --- redpen-cli/pom.xml | 2 +- redpen-cli/src/main/java/cc/redpen/Main.java | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/redpen-cli/pom.xml b/redpen-cli/pom.xml index 2395c2d5c..d01b092e1 100644 --- a/redpen-cli/pom.xml +++ b/redpen-cli/pom.xml @@ -117,7 +117,7 @@ commons-cli commons-cli - 1.2 + 1.4 ch.qos.logback diff --git a/redpen-cli/src/main/java/cc/redpen/Main.java b/redpen-cli/src/main/java/cc/redpen/Main.java index 976946058..106c89e3a 100644 --- a/redpen-cli/src/main/java/cc/redpen/Main.java +++ b/redpen-cli/src/main/java/cc/redpen/Main.java @@ -46,6 +46,13 @@ public final class Main { private static final int DEFAULT_LIMIT = 1; + private static final String HELP_HEADER = "\nValidate input documents with specified configuration settings.\n\nOptions:\n"; + + private static final String HELP_FOOTER = "\n\nExample:\n\n" + + "$redpen -c redpen-config.xml input.md\n\n" + + "Note:\n" + + "Setting files can be generated in http://redpen.herokuapp.com/\n"; + private Main() { super(); } @@ -279,7 +286,7 @@ private static void printHelp(Options opt) { HelpFormatter formatter = new HelpFormatter(); formatter.setWidth(100); PrintWriter pw = new PrintWriter(System.err); - formatter.printHelp(pw, 80, PROGRAM + " [Options] []", null, opt, 1, 3, ""); + formatter.printHelp(pw, 80, PROGRAM + " [Options] []", HELP_HEADER, opt, 1, 3, HELP_FOOTER); pw.flush(); }