irqtop: add bash-completion
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
This commit is contained in:
parent
050dc9f923
commit
e11f242769
|
@ -45,6 +45,9 @@ endif
|
|||
if BUILD_IPCS
|
||||
dist_bashcompletion_DATA += bash-completion/ipcs
|
||||
endif
|
||||
if BUILD_IRQTOP
|
||||
dist_bashcompletion_DATA += bash-completion/irqtop
|
||||
endif
|
||||
if BUILD_ISOSIZE
|
||||
dist_bashcompletion_DATA += bash-completion/isosize
|
||||
endif
|
||||
|
|
|
@ -0,0 +1,28 @@
|
|||
_irqtop_module()
|
||||
{
|
||||
local cur prev OPTS
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
case $prev in
|
||||
'-d'|'--delay')
|
||||
COMPREPLY=( $(compgen -W "secs" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-s'|'--sort')
|
||||
COMPREPLY=( $(compgen -W "c i n" -- $cur) )
|
||||
return 0
|
||||
;;
|
||||
'-h'|'--help'|'-V'|'--version')
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
OPTS=" --delay
|
||||
--once
|
||||
--sort
|
||||
--help
|
||||
--version"
|
||||
COMPREPLY=( $(compgen -W "${OPTS[*]}" -- $cur) )
|
||||
return 0
|
||||
}
|
||||
complete -F _irqtop_module irqtop
|
Loading…
Reference in New Issue