prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-s'|'--shell')
- COMPREPLY=( $(compgen -W "$(chsh -l)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$($1 -l)" -- $cur) )
return 0
;;
'-u'|'--help'|'-v'|'--version')
return 0
;;
'-x'|'--cdspeed')
- COMPREPLY=( $(compgen -W "$(eject -X)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$($1 -X)" -- $cur) )
return 0
;;
'-h'|'--help'|'-V'|'--version')
for I in ${TMP_ARR[@]}; do
MNT_OPTS[$I]='1'
done
- done < <(findmnt -rno OPTIONS)
+ done < <($1 -rno OPTIONS)
COMPREPLY=( $(compgen -W "${!MNT_OPTS[@]}" -- $cur) )
return 0
;;
;;
'-S'|'--source')
local DEV_MPOINT
- DEV_MPOINT=$(findmnt -rno SOURCE | grep ^/dev)
+ DEV_MPOINT=$($1 -rno SOURCE | grep ^/dev)
COMPREPLY=( $(compgen -W "$DEV_MPOINT" -- $cur) )
return 0
;;
'-T'|'--target')
local DEV_MPOINT
- DEV_MPOINT=$(findmnt -rno TARGET)
+ DEV_MPOINT=$($1 -rno TARGET)
COMPREPLY=( $(compgen -W "$DEV_MPOINT" -- $cur) )
return 0
;;
;;
esac
local DEV_MPOINT
- DEV_MPOINT=$(findmnt -rno TARGET,SOURCE)
+ DEV_MPOINT=$($1 -rno TARGET,SOURCE)
COMPREPLY=( $(compgen -W "$DEV_MPOINT" -- $cur) )
return 0
}
prev="${COMP_WORDS[COMP_CWORD-1]}"
case $prev in
'-d'|'--detach')
- ARG="$(losetup --output NAME | awk '{if (1 < NR) {print}}')"
+ ARG="$($1 --output NAME | awk '{if (1 < NR) {print}}')"
COMPREPLY=( $(compgen -W "$ARG" -- $cur) )
return 0
;;
'-j'|'--associated')
- ARG="$(losetup --output BACK-FILE | awk '{if (1 < NR) {print}}')"
+ ARG="$($1 --output BACK-FILE | awk '{if (1 < NR) {print}}')"
COMPREPLY=( $(compgen -W "$ARG" -- $cur) )
return 0
;;
;;
esac
local DEVS
- COMPREPLY=( $(compgen -W "$(lsblk -pnro name)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$($1 -pnro name)" -- $cur) )
return 0
}
complete -F _lsblk_module lsblk
;;
esac
if [ $COMP_CWORD -eq 1 ]; then
- COMPREPLY=( $(compgen -W "$(setarch --list)" -- $cur) )
+ COMPREPLY=( $(compgen -W "$($1 --list)" -- $cur) )
return 0
fi
case $cur in
'--inh-caps'|'--bounding-set')
# FIXME: how to append to a string with compgen?
local INHERIT
- INHERIT=$(setpriv --list-caps| awk '{print $1, "-" $1}')
+ INHERIT=$($1 --list-caps| awk '{print $1, "-" $1}')
compopt -o nospace
COMPREPLY=( $(compgen -W "all $INHERIT" -S ',' -- $cur) )
return 0