]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
bash-completion: Avoid some unnecessary subshells.
authorVille Skyttä <ville.skytta@iki.fi>
Sun, 7 Apr 2013 08:12:05 +0000 (11:12 +0300)
committerKarel Zak <kzak@redhat.com>
Mon, 8 Apr 2013 15:06:53 +0000 (17:06 +0200)
Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
bash-completion/findmnt
bash-completion/flock
bash-completion/ionice
bash-completion/logger
bash-completion/renice
bash-completion/setterm
bash-completion/swapon

index cdc4861c22c38e58ccecbe32ba8c94adcf2d433f..a6d526f7149c936cd4289ca9cd8aa96e694faccb 100644 (file)
@@ -38,7 +38,7 @@ _findmnt_module()
                                        MNT_OPTS[$I]='1'
                                done
                        done < <(findmnt -rno OPTIONS)
-                       COMPREPLY=( $(compgen -W "$(echo ${!MNT_OPTS[@]})" -- $cur) )
+                       COMPREPLY=( $(compgen -W "${!MNT_OPTS[@]}" -- $cur) )
                        return 0
                        ;;
                '-o'|'--output')
index 3f094e37d7634c66ae80d6da2e7ade323d0bb5ea..918a7d894e2c7a9de72323f4922c6a6a3a63928f 100644 (file)
@@ -10,7 +10,7 @@ _flock_module()
                        return 0
                        ;;
                '-E'|'--conflict-exit-code')
-                       COMPREPLY=( $(compgen -W "$(echo {0..255})" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{0..255}" -- $cur) )
                        return 0
                        ;;
                '-c'|'--command')
index e7a8ac868142bdb36ae4b55325945db9455b2806..4d5596896d85fc4b17f53656ed7a51b38dab5e46 100644 (file)
@@ -6,11 +6,11 @@ _ionice_module()
        prev="${COMP_WORDS[COMP_CWORD-1]}"
        case $prev in
                '-c'|'--class')
-                       COMPREPLY=( $(compgen -W "$(echo {0..3}) none realtime best-effort idle" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{0..3} none realtime best-effort idle" -- $cur) )
                        return 0
                        ;;
                '-n'|'--classdata')
-                       COMPREPLY=( $(compgen -W "$(echo {0..7})" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{0..7}" -- $cur) )
                        return 0
                        ;;
                '-p'|'--pid')
index 1f89e2dca4bc827179c359511fa9da40a6ea1e54..7a2b46036253f602d4835ce19c56cb7ecd855cb1 100644 (file)
@@ -19,7 +19,7 @@ _logger_module()
                        return 0
                        ;;
                '-p'|'--priority')
-                       COMPREPLY=( $(compgen -W "$(echo {auth,authpriv,cron,daemon,ftp,lpr,mail,news,security}.{alert,crit,debug,emerg,err,error})" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{auth,authpriv,cron,daemon,ftp,lpr,mail,news,security}.{alert,crit,debug,emerg,err,error}" -- $cur) )
                        return 0
                        ;;
                '-t'|'--tag')
index deb979327fe1857cb43f62f21bbd388104801711..9693590f87e89805b25ff6478f5ad7a272bb367a 100644 (file)
@@ -12,7 +12,7 @@ _renice_module()
                        return 0
                        ;;
                '-n'|'--priority')
-                       COMPREPLY=( $(compgen -W "$(echo {-20..20})" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{-20..20}" -- $cur) )
                        return 0
                        ;;
                '-p'|'--pid')
index ae07d1ee6e3532444a76c0c50b8774666002454a..7fa0a4e457f63a462863d72b40478c87d7ad90b1 100644 (file)
@@ -31,17 +31,17 @@ _setterm_module()
                        return 0
                        ;;
                '-regtabs')
-                       COMPREPLY=( $(compgen -W "$(echo {1..160})" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{1..160}" -- $cur) )
                        return 0
                        ;;
                '-blank')
-                       COMPREPLY=( $(compgen -W "$(echo {0..60}) force poke" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{0..60} force poke" -- $cur) )
                        return 0
                        ;;
                '-dump'|'-append')
                        local NUM_CONS
                        NUM_CONS=(/sys/class/tty/*)
-                       COMPREPLY=( $(compgen -W "$(echo {1..${#NUM_CONS[*]}})" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{1..${#NUM_CONS[*]}}" -- $cur) )
                        return 0
                        ;;
                '-file')
@@ -50,7 +50,7 @@ _setterm_module()
                        return 0
                        ;;
                '-msglevel')
-                       COMPREPLY=( $(compgen -W "$(echo {1..8})" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{1..8}" -- $cur) )
                        return 0
                        ;;
                '-powersave')
@@ -58,7 +58,7 @@ _setterm_module()
                        return 0
                        ;;
                '-powerdown')
-                       COMPREPLY=( $(compgen -W "$(echo {0..60})" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{0..60}" -- $cur) )
                        return 0
                        ;;
                '-blength')
index 0e7c2008ba5a9310f81fa8bc682dad224239dac8..6e05b6e1ed881fcc847c09eb36b6545528869669 100644 (file)
@@ -8,7 +8,7 @@ _swapon_module()
                '-p'|'--priority')
                        # Priority range is -1 to 32767.  Perhaps these
                        # few are enough.
-                       COMPREPLY=( $(compgen -W "$(echo {-1..9} 32767)" -- $cur) )
+                       COMPREPLY=( $(compgen -W "{-1..9} 32767" -- $cur) )
                        return 0
                        ;;
                '--show')