]> git.corax.cc Git - toolbox/commitdiff
include/inst: Expect arguments from opt_get_argv() in multiple lines
authorMatthias Kruk <m@m10k.eu>
Sun, 27 Feb 2022 09:02:18 +0000 (18:02 +0900)
committerMatthias Kruk <m@m10k.eu>
Sun, 27 Feb 2022 09:04:31 +0000 (18:04 +0900)
The inst module expects `opt_get_argv()` to print all command line
arguments in one line, however the behavior of `opt_get_argv()` has
been changed to print arguments line-by-line.

This commit modifies the inst module so that it expects arguments to
be returned one per line by `opt_get_argv()`.

include/inst.sh

index 398da981ccff31f182f9b230709d2a3b2462f8ba..551b959c95917f6164b6037b7fb6e041169fa386 100644 (file)
@@ -87,7 +87,7 @@ inst_list() {
                local owner
                local semval
                local state
-               local argv
+               local argv
                local status_text
                local status_time
                local timestamp
@@ -95,7 +95,7 @@ inst_list() {
                owner="${sem##*/}"
                semval=$(sem_peek "$sem")
 
-               if ! argv=$(<"$sem.argv") 2> /dev/null; then
+               if ! readarray -t argv < "$sem.argv" 2> /dev/null; then
                        continue
                fi
 
@@ -114,7 +114,7 @@ inst_list() {
                        state="RUNNING"
                fi
 
-               echo "$owner $state [$timestamp:$status_text] $instname $argv"
+               echo "$owner $state [$timestamp:$status_text] $instname ${argv[*]}"
        done < <(find "$instpath" -regex ".*/[0-9]+")
 
        return 0