Skip to content

Commit

Permalink
Fixes #235 - showing help is now default action when no args are
Browse files Browse the repository at this point in the history
supplied.
  • Loading branch information
jonbullock committed Jul 4, 2016
1 parent 038e928 commit 7248d37
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/jbake/launcher/LaunchOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public String getDestinationValue() {
}

public boolean isHelpNeeded() {
return helpNeeded;
return helpNeeded || !(isBake() || isRunServer() || isInit() || source != null || destination != null);
}

public boolean isRunServer() {
Expand All @@ -78,6 +78,6 @@ public boolean isClearCache() {
}

public boolean isBake() {
return bake || !(isHelpNeeded() || isRunServer() || isInit());
return bake || (source != null && destination != null);
}
}
4 changes: 2 additions & 2 deletions src/test/java/org/jbake/launcher/LaunchOptionsTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,10 @@ public void bakeNoArgs() throws Exception {
CmdLineParser parser = new CmdLineParser(res);
parser.parseArgument(args);

assertThat(res.isHelpNeeded()).isFalse();
assertThat(res.isHelpNeeded()).isTrue();
assertThat(res.isRunServer()).isFalse();
assertThat(res.isInit()).isFalse();
assertThat(res.isBake()).isTrue();
assertThat(res.isBake()).isFalse();
assertThat(res.getSource().getPath()).isEqualTo(".");
assertThat(res.getDestination()).isNull();
}
Expand Down

0 comments on commit 7248d37

Please sign in to comment.