From: Ben Soares Date: Sun, 21 May 2023 15:45:03 +0000 (+0100) Subject: JAL-629 Clarify sections of arguments with --help-all (or multiple --help-...) X-Git-Tag: Release_2_11_4_0~304 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=5f75f9bff16bce462ef737bacfadd3463366c5c0;p=jalview.git JAL-629 Clarify sections of arguments with --help-all (or multiple --help-...) --- diff --git a/src/jalview/bin/argparser/Arg.java b/src/jalview/bin/argparser/Arg.java index 8003245..ae01c48 100644 --- a/src/jalview/bin/argparser/Arg.java +++ b/src/jalview/bin/argparser/Arg.java @@ -522,9 +522,9 @@ public enum Arg { StringBuilder sb = new StringBuilder(); - sb.append("usage: jalview [" + Arg.HEADLESS.argString() + "] [" + sb.append("usage: jalview [" + Arg.HEADLESS.argString() + "] [[" + Arg.OPEN.argString() + "/" + Arg.APPEND.argString() - + " file(s)] [args]"); + + "] file(s)] [args]"); sb.append(System.lineSeparator()); sb.append(System.lineSeparator()); @@ -567,6 +567,7 @@ public enum Arg } Iterator argsI = args.iterator(); + Type typeSection = null; while (argsI.hasNext()) { Arg a = argsI.next(); @@ -577,10 +578,27 @@ public enum Arg continue; } + if (a.getType() != typeSection) + { + typeSection = a.getType(); + String typeDescription = a.getType().description(); + if (typeDescription != null && typeDescription.length() > 0) + { + // typeDescription = typeDescription.substring(0, + // 1).toUpperCase(Locale.ROOT) + typeDescription.substring(1); + typeDescription = typeDescription.toUpperCase(Locale.ROOT); + sb.append(typeDescription); + sb.append(System.lineSeparator()); + sb.append(System.lineSeparator()); + } + } + appendArgUsage(sb, a, maxArgLength); if (argsI.hasNext()) + { sb.append(System.lineSeparator()); + } } } return sb.toString();