mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
added groups for subcommands
This commit is contained in:
@@ -152,15 +152,7 @@ public class App
|
||||
|
||||
if ((args.length == 0) || (subcommand == null) || help)
|
||||
{
|
||||
parser.printUsage(output, i18n.getBundle());
|
||||
output.println();
|
||||
output.println(i18n.getMessage(I18n.SUBCOMMANDS_TITLE));
|
||||
|
||||
for (CommandDescriptor desc :
|
||||
SubCommandHandler.getInstance().getDescriptors())
|
||||
{
|
||||
output.append(" ").println(desc.getName());
|
||||
}
|
||||
printHelp(parser, i18n);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -199,6 +191,37 @@ public class App
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Method description
|
||||
*
|
||||
*
|
||||
* @param parser
|
||||
* @param i18n
|
||||
*/
|
||||
private void printHelp(CmdLineParser parser, I18n i18n)
|
||||
{
|
||||
parser.printUsage(output, i18n.getBundle());
|
||||
output.println();
|
||||
output.println(i18n.getMessage(I18n.SUBCOMMANDS_TITLE));
|
||||
output.println();
|
||||
|
||||
String group = null;
|
||||
|
||||
for (CommandDescriptor desc :
|
||||
SubCommandHandler.getInstance().getDescriptors())
|
||||
{
|
||||
if ((group == null) ||!group.equals(desc.getGroup()))
|
||||
{
|
||||
output.println();
|
||||
group = desc.getGroup();
|
||||
output.append(i18n.getMessage(group)).println(":");
|
||||
output.println();
|
||||
}
|
||||
|
||||
output.append(" ").println(desc.getName());
|
||||
}
|
||||
}
|
||||
|
||||
//~--- fields ---------------------------------------------------------------
|
||||
|
||||
/** Field description */
|
||||
|
||||
Reference in New Issue
Block a user