Skip to content

Commit

Permalink
set usage help autowidth option and align usage help long options max…
Browse files Browse the repository at this point in the history
… width
  • Loading branch information
ancho committed Jun 1, 2020
1 parent 54b8786 commit 9cb42b5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@

@Command(
description = "JBake is a Java based, open source, static site/blog generator for developers & designers",
name = "jbake"
name = "jbake",
usageHelpAutoWidth = true
)
public class LaunchOptions {
@Parameters(index = "0", description = "source folder of site content (with templates and assets), if not supplied will default to current directory", arity = "0..1")
Expand All @@ -21,7 +22,7 @@ public class LaunchOptions {
@Option(names = {"-b", "--bake"}, description = "performs a bake")
private boolean bake;

@ArgGroup(exclusive = false, heading = "JBake initialization%n")
@ArgGroup(exclusive = false, heading = "%n%nJBake initialization%n%n")
private InitOptions initGroup;

static class InitOptions {
Expand Down
4 changes: 3 additions & 1 deletion jbake-core/src/main/java/org/jbake/launcher/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,9 @@ private LaunchOptions parseArguments(String[] args) {
}

private void printUsage(Object options) {
CommandLine.usage(options, System.out);
CommandLine cli = new CommandLine(options);
cli.setUsageHelpLongOptionsMaxWidth(28);
cli.usage(System.out);
}

public static void printUsage() {
Expand Down

0 comments on commit 9cb42b5

Please sign in to comment.