bash-completion: Avoid some unnecessary subshells.

Signed-off-by: Ville Skyttä <ville.skytta@iki.fi>
This commit is contained in:
Ville Skyttä 2013-04-07 11:12:05 +03:00 committed by Karel Zak
parent d4f9b8d74c
commit d6b975ef44
7 changed files with 12 additions and 12 deletions

View 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')

View 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')

View 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')

View 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')

View 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')

View 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')

View 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')