|
|
@ -73,6 +73,9 @@ public class Main { |
|
|
|
@Option(name = "--help", usage = "usage_displayThisHelpText", aliases = { "-h" }) |
|
|
|
@Option(name = "--help", usage = "usage_displayThisHelpText", aliases = { "-h" }) |
|
|
|
private boolean help; |
|
|
|
private boolean help; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Option(name = "--version", usage = "usage_displayVersion") |
|
|
|
|
|
|
|
private boolean version; |
|
|
|
|
|
|
|
|
|
|
|
@Option(name = "--show-stack-trace", usage = "usage_displayThejavaStackTraceOnExceptions") |
|
|
|
@Option(name = "--show-stack-trace", usage = "usage_displayThejavaStackTraceOnExceptions") |
|
|
|
private boolean showStackTrace; |
|
|
|
private boolean showStackTrace; |
|
|
|
|
|
|
|
|
|
|
@ -167,7 +170,7 @@ public class Main { |
|
|
|
try { |
|
|
|
try { |
|
|
|
clp.parseArgument(argv); |
|
|
|
clp.parseArgument(argv); |
|
|
|
} catch (CmdLineException err) { |
|
|
|
} catch (CmdLineException err) { |
|
|
|
if (argv.length > 0 && !help) { |
|
|
|
if (argv.length > 0 && !help && !version) { |
|
|
|
writer.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage())); |
|
|
|
writer.println(MessageFormat.format(CLIText.get().fatalError, err.getMessage())); |
|
|
|
writer.flush(); |
|
|
|
writer.flush(); |
|
|
|
System.exit(1); |
|
|
|
System.exit(1); |
|
|
@ -204,6 +207,11 @@ public class Main { |
|
|
|
System.exit(1); |
|
|
|
System.exit(1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (version) { |
|
|
|
|
|
|
|
String cmdId = Version.class.getSimpleName().toLowerCase(); |
|
|
|
|
|
|
|
subcommand = CommandCatalog.get(cmdId).create(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
final TextBuiltin cmd = subcommand; |
|
|
|
final TextBuiltin cmd = subcommand; |
|
|
|
if (cmd.requiresRepository()) |
|
|
|
if (cmd.requiresRepository()) |
|
|
|
cmd.init(openGitDir(gitdir), null); |
|
|
|
cmd.init(openGitDir(gitdir), null); |
|
|
|