Skip to content

Commit

Permalink
Enrich help message
Browse files Browse the repository at this point in the history
  • Loading branch information
takahi-i committed Mar 25, 2018
1 parent 60e4af3 commit 7a56544
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion redpen-cli/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.2</version>
<version>1.4</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
Expand Down
9 changes: 8 additions & 1 deletion redpen-cli/src/main/java/cc/redpen/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down Expand Up @@ -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] [<INPUT FILE>]", null, opt, 1, 3, "");
formatter.printHelp(pw, 80, PROGRAM + " [Options] [<INPUT FILE>]", HELP_HEADER, opt, 1, 3, HELP_FOOTER);
pw.flush();
}

Expand Down

0 comments on commit 7a56544

Please sign in to comment.