]> git.ipfire.org Git - thirdparty/mtr.git/commitdiff
fix shellcheck warnings
authora1346054 <36859588+a1346054@users.noreply.github.com>
Sun, 5 Sep 2021 13:12:42 +0000 (13:12 +0000)
committera1346054 <36859588+a1346054@users.noreply.github.com>
Sun, 5 Sep 2021 13:45:04 +0000 (13:45 +0000)
bash-completion/mtr
build-aux/mangen.sh

index 22df752d286a2ecaa9daa3fdd40e7e04ceccb4b1..63b153b1aff490c7c295576635c195906414a212 100644 (file)
@@ -8,43 +8,43 @@ _mtr_module()
     '-F'|'--filename')
       local IFS=$'\n'
       compopt -o filenames
-      COMPREPLY=( $(compgen -f -- $cur) )
+      COMPREPLY=( $(compgen -f -- "$cur") )
       return 0
       ;;
     '-a'|'--address')
-      COMPREPLY=( $(compgen -W "ADDRESS" -- $cur) )
+      COMPREPLY=( $(compgen -W "ADDRESS" -- "$cur") )
       return 0
       ;;
     '-f'|'--first-ttl'|'-m'|'--max-ttl'|'-U'|'--max-unknown'|'-B'|'--bitpattern'|'-Q'|'--tos'|'-c'|'--report-cycles')
-      COMPREPLY=( $(compgen -W "NUMBER" -- $cur) )
+      COMPREPLY=( $(compgen -W "NUMBER" -- "$cur") )
       return 0
       ;;
     '-P'|'--port'|'-L'|'--localport')
-      COMPREPLY=( $(compgen -W "PORT" -- $cur) )
+      COMPREPLY=( $(compgen -W "PORT" -- "$cur") )
       return 0
       ;;
     '-s'|'--psize')
-      COMPREPLY=( $(compgen -W "SIZE" -- $cur) )
+      COMPREPLY=( $(compgen -W "SIZE" -- "$cur") )
       return 0
       ;;
     '-i'|'--interval'|'-G'|'--gracetime'|'-Z'|'--timeout')
-      COMPREPLY=( $(compgen -W "SECONDS" -- $cur) )
+      COMPREPLY=( $(compgen -W "SECONDS" -- "$cur") )
       return 0
       ;;
     '-M'|'--mark')
-      COMPREPLY=( $(compgen -W "MARK" -- $cur) )
+      COMPREPLY=( $(compgen -W "MARK" -- "$cur") )
       return 0
       ;;
     '--displaymode')
-      COMPREPLY=( $(compgen -W "{0..2}" -- $cur) )
+      COMPREPLY=( $(compgen -W "{0..2}" -- "$cur") )
       return 0
       ;;
     '-y'|'--ipinfo')
-      COMPREPLY=( $(compgen -W "{0..4}" -- $cur) )
+      COMPREPLY=( $(compgen -W "{0..4}" -- "$cur") )
       return 0
       ;;
     '-o'|'--order')
-      COMPREPLY=( $(compgen -W "LDRSNBAWVGJMXI" -- $cur) )
+      COMPREPLY=( $(compgen -W "LDRSNBAWVGJMXI" -- "$cur") )
       return 0
       ;;
   esac
@@ -58,11 +58,11 @@ _mtr_module()
         --curses --displaymode --gtk --no-dns --show-ips --order --ipinfo
         --aslookup --help --version
       '
-      COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
+      COMPREPLY=( $(compgen -W "${OPTS[*]}" -- "$cur") )
       return 0
       ;;
   esac
-  COMPREPLY=( $(compgen -W "ip_address hostname" -- $cur) )
+  COMPREPLY=( $(compgen -W "ip_address hostname" -- "$cur") )
   return 0
 }
 complete -F _mtr_module mtr
index 6ce777e71b0a5493a4ed181704b039fc68c265ec..cdc2a010e7ca0966255b0ea871b906f57bb0d232 100755 (executable)
@@ -7,7 +7,7 @@
 #
 
 if [ $# -lt 3 ]; then
-    echo Usage: mangen.sh VERSION IN OUT
+    echo "Usage: mangen.sh VERSION IN OUT"
     exit 1
 fi
 
@@ -20,10 +20,10 @@ OUT=$3
 #  URL completely disappear from man pages.  We need to strip
 #  those codes out when building for MacOS
 #
-if [ $(uname -s) = "Darwin" ]; then
+if [ "$(uname -s)" = "Darwin" ]; then
    RMURUE='-e s/\.UR.//g -e s/\.UE//g'
 else
    RMURUE=""
 fi
 
-sed -e "s|@VERSION[@]|$VERSION|g" $RMURUE $IN >$OUT
+sed -e "s|@VERSION[@]|$VERSION|g" $RMURUE "$IN" >"$OUT"