clp.parseArgument(argv);
} catch (CmdLineException e) {
if (argv.length > 0 && !help) {
writer.println(MessageFormat.format(CLIText.get().fatalError, e.getMessage()));
writer.flush();
throw new Die(true);
}
}
if (argv.length == 0 || help) {
final String ex = clp.printExample(ExampleMode.ALL, CLIText.get().resourceBundle());
writer.println("jgit" + ex + " command [ARG ...]"); //$NON-NLS-1$
if (help) {
writer.println();
clp.printUsage(writer, CLIText.get().resourceBundle());
writer.println();
} else if (subcommand == null) {
writer.println();
writer.println(CLIText.get().mostCommonlyUsedCommandsAre);
final CommandRef[] common = CommandCatalog.common();
int width = 0;
for (final CommandRef c : common)
width = Math.max(width, c.getName().length());
width += 2;
for (final CommandRef c : common) {
writer.print(' ');
writer.print(c.getName());
for (int i = c.getName().length(); i < width; i++)
writer.print(' ');
writer.print(CLIText.get().resourceBundle().getString(c.getUsage()));
writer.println();
}
writer.println();
}
writer.flush();
throw new Die(true);
}
gitdir = new File(rootDir, gitdir).getPath();
final TextBuiltin cmd = subcommand;