reworked Option.toString()

This commit is contained in:
Marcel Otte 2014-12-09 20:46:50 +01:00
parent c6daefd033
commit cc15618dca
1 changed files with 13 additions and 6 deletions

View File

@ -146,13 +146,20 @@ public class CmdOptions {
public String toString() { public String toString() {
String ret = name + " ("; String ret = name + " (";
for (String s : cmd) { for (String s : cmd) {
ret += optionChar + s + ", ";
}
for (String s : cmdLong) {
ret += optionChar + s + ", ";
}
ret += ")";
if (defaultParameter.size() > 0) {
ret += ": default=";
for (String s : defaultParameter) {
ret += s + ","; ret += s + ",";
} }
ret += ")" }
+ (defaultParameter != null ? ": default=" ret += (description != null ? "\n\t\t" + description : "");
+ defaultParameter : "") if (possibleParams.size() > 0) {
+ (description != null ? "\n\t\t" + description : "");
if (possibleParams != null) {
boolean start = true; boolean start = true;
ret += "\n\t\t(Possible parameters: "; ret += "\n\t\t(Possible parameters: ";
for (String s : possibleParams) { for (String s : possibleParams) {