public String usage() { String progName = mProgName != null ? mProgName : "progname"; String optsString1 = (mValidOptionNames != null && mValidOptionNames.size() > 0) ? " <options>" : ""; String nonOptArgsString = (mNonOptParamNames != null && mNonOptParamNames.size() > 0) ? " <" + StringUtils.listToString(mNonOptParamNames, "> <") + ">" : ""; String optsString2 = (mValidOptionNames != null && mValidOptionNames.size() > 0) ? "\nOPTIONS:\n" + optsWithValString() + "\n" + optsWithoutValString() : ""; return "Usage: " + progName + optsString1 + nonOptArgsString + optsString2; }
public String toString() { // @todo: improve? List fields = formatFields(); return StringUtils.listToString(fields, " "); }