mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-13 08:55:44 +01:00
added support for usage messages
This commit is contained in:
@@ -206,6 +206,21 @@ public class App
|
|||||||
output.println();
|
output.println();
|
||||||
|
|
||||||
String group = null;
|
String group = null;
|
||||||
|
List<CommandDescriptor> descList =
|
||||||
|
SubCommandHandler.getInstance().getDescriptors();
|
||||||
|
int length = 0;
|
||||||
|
|
||||||
|
for (CommandDescriptor desc : descList)
|
||||||
|
{
|
||||||
|
int l = desc.getName().length();
|
||||||
|
|
||||||
|
if (l > length)
|
||||||
|
{
|
||||||
|
length = l;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
length += 2;
|
||||||
|
|
||||||
for (CommandDescriptor desc :
|
for (CommandDescriptor desc :
|
||||||
SubCommandHandler.getInstance().getDescriptors())
|
SubCommandHandler.getInstance().getDescriptors())
|
||||||
@@ -218,7 +233,17 @@ public class App
|
|||||||
output.println();
|
output.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
output.append(" ").println(desc.getName());
|
int l = desc.getName().length();
|
||||||
|
|
||||||
|
output.append(" ").append(desc.getName());
|
||||||
|
l = length - l;
|
||||||
|
|
||||||
|
for (int i = 0; i < l; i++)
|
||||||
|
{
|
||||||
|
output.append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
|
output.println(i18n.getMessage(desc.getUsage()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -200,5 +200,5 @@ public class CommandDescriptor implements Comparable<CommandDescriptor>
|
|||||||
private String name;
|
private String name;
|
||||||
|
|
||||||
/** Field description */
|
/** Field description */
|
||||||
private String usage;
|
private String usage = "";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user