From 51909770452369f94b4a0070482ab0acdd96fada Mon Sep 17 00:00:00 2001 From: Ben Soares Date: Sat, 20 May 2023 11:45:36 +0100 Subject: [PATCH] JAL-4187 JAL-629 JAL-3830 adjustments to Cygwin and WSL parts of bash launcher script and usage statement after testing --- src/jalview/bin/argparser/Arg.java | 17 +++++++---------- utils/getdown/bin/jalview.sh | 4 +--- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/src/jalview/bin/argparser/Arg.java b/src/jalview/bin/argparser/Arg.java index 958569e..2a080fc 100644 --- a/src/jalview/bin/argparser/Arg.java +++ b/src/jalview/bin/argparser/Arg.java @@ -198,7 +198,7 @@ public enum Arg Opt.UNARY, Opt.MULTI, Opt.NOACTION, Opt.INCREMENTDEFAULTCOUNTER), SUBSTITUTIONS(Type.FLOW, "The following argument values allow (or don't allow) subsituting filename parts. This is initially true. Valid substitutions are {basename} - the filename-without-extension of the currently --opened file (or first --appended file),\n" - + "{dirname}, - the directory (folder) name of the currently --opened file (or first --appended file),\n" + + "{dirname} - the directory (folder) name of the currently --opened file (or first --appended file),\n" + "{argfilebasename} - the filename-without-extension of the current --argfile,\n" + "{argfiledirname} - the directory (folder) name of the current --argfile,\n" + "{n} - the value of the index counter (starting at 0).\n" @@ -703,15 +703,8 @@ public enum Arg while (line.length() > descLength) { int splitIndex = line.lastIndexOf(" ", descLength); - if (splitIndex > descLength) - { - break; - } - else - { - splitDescLinesList.add(line.substring(0, splitIndex)); - line = line.substring(splitIndex + 1); - } + splitDescLinesList.add(line.substring(0, splitIndex)); + line = line.substring(splitIndex + 1); } splitDescLinesList.add(line); } @@ -723,11 +716,15 @@ public enum Arg while (splitDescLines.hasNext()) { if (first) + { sb.append(ARGDESCRIPTIONSEPARATOR); + } else + { sb.append(String.format("%-" + (maxArgLength + ARGDESCRIPTIONSEPARATOR.length()) + "s", "")); + } sb.append(splitDescLines.next()); sb.append(System.lineSeparator()); first = false; diff --git a/utils/getdown/bin/jalview.sh b/utils/getdown/bin/jalview.sh index 912f1ad..62da28c 100755 --- a/utils/getdown/bin/jalview.sh +++ b/utils/getdown/bin/jalview.sh @@ -80,7 +80,6 @@ fi if [ "${ISMACOS}" != 1 ]; then # older macos doesn't like uname -o, best to avoid if [ "$(uname -o)" = "Cygwin" ]; then # CYGWIN - echo "When using relative paths in args within Cygwin, please start with './' or '../'" >&2 CLASSPATH=$(cygpath -pw "${CLASSPATH}") # now for some arg paths fun. only translating paths starting with './', '../', '/' or '~' ARGS=() @@ -91,9 +90,8 @@ if [ "${ISMACOS}" != 1 ]; then # older macos doesn't like uname -o, best to avoi ARGS=( "${ARGS[@]}" "${ARG}" ) fi done - elif uname -r | grep Microsoft >/dev/null; then + elif uname -r | grep -i microsoft | grep -i wsl >/dev/null; then # WSL - echo "When using relative paths in args within WSL, please start with './' or '../'" >&2 CLASSPATH="" for JARPATH in "${JARPATHS[@]}"; do [ -n "${CLASSPATH}" ] && CLASSPATH="${CLASSPATH};" -- 1.7.10.2