Skip to content

Commit

Permalink
improve help message
Browse files Browse the repository at this point in the history
  • Loading branch information
h908714124 committed Apr 26, 2021
1 parent 638457a commit 85bf985
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -490,14 +490,14 @@ private MethodSpec parseOrExitMethod(Modifier[] accessModifiers) {
.endControlFlow());

code.addStatement("(($T) $N).getError().printStackTrace($N)", generatedTypes.parsingFailedType(), result, err);
code.addStatement("$N.println($S + (($T) $N).getError().getMessage())", err, "Error: ", generatedTypes.parsingFailedType(), result);
if (!context.isHelpParameterEnabled()) {
code.addStatement("printOnlineHelp($N)", err);
} else {
code.addStatement("printTokens($N, $L, synopsis())", err, INDENT_SYNOPSIS);
}
code.addStatement("$N.println($S + (($T) $N).getError().getMessage())", err, "Error: ", generatedTypes.parsingFailedType(), result);
if (context.isHelpParameterEnabled()) {
code.addStatement("$N.println($S)", err, "Try '--help' for more information.");
code.addStatement("$N.println($S + $N + $S)", err, "Try '", programName, " --help' for more information.");
}
code.addStatement("$N.flush()", err)
.addStatement("$N.accept($N, 1)", exitHook, result)
Expand Down

0 comments on commit 85bf985

Please sign in to comment.