2013-03-24 12:10:55 -05:00
|
|
|
_ionice_module()
|
|
|
|
{
|
|
|
|
local cur prev OPTS
|
|
|
|
COMPREPLY=()
|
|
|
|
cur="${COMP_WORDS[COMP_CWORD]}"
|
|
|
|
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
|
|
|
case $prev in
|
|
|
|
'-c'|'--class')
|
2013-04-07 03:12:05 -05:00
|
|
|
COMPREPLY=( $(compgen -W "{0..3} none realtime best-effort idle" -- $cur) )
|
2013-03-24 12:10:55 -05:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
'-n'|'--classdata')
|
2013-04-07 03:12:05 -05:00
|
|
|
COMPREPLY=( $(compgen -W "{0..7}" -- $cur) )
|
2013-03-24 12:10:55 -05:00
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
'-p'|'--pid')
|
|
|
|
local PIDS
|
|
|
|
PIDS=$(for I in /proc/[0-9]*; do echo ${I##"/proc/"}; done)
|
|
|
|
COMPREPLY=( $(compgen -W "$PIDS" -- $cur) )
|
|
|
|
return 0
|
|
|
|
;;
|
2013-04-07 03:12:04 -05:00
|
|
|
'-h'|'--help'|'-V'|'--version')
|
|
|
|
return 0
|
|
|
|
;;
|
2013-03-24 12:10:55 -05:00
|
|
|
esac
|
|
|
|
case $cur in
|
|
|
|
-*)
|
2013-04-07 03:12:08 -05:00
|
|
|
OPTS="--class --classdata --pid --ignore --version --help"
|
2013-03-24 12:10:55 -05:00
|
|
|
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
|
|
|
return 0
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
compopt -o filenames
|
|
|
|
COMPREPLY=( $(compgen -f -- $cur) )
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
complete -F _ionice_module ionice
|