From: Sami Kerola Date: Sat, 8 Feb 2020 16:28:52 +0000 (+0000) Subject: irqtop: add bash-completion X-Git-Tag: v2.36-rc1~196^2~35 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e11f242769153602f2c6c54e1a1a858ab7c95974;p=thirdparty%2Futil-linux.git irqtop: add bash-completion Signed-off-by: Sami Kerola --- diff --git a/bash-completion/Makemodule.am b/bash-completion/Makemodule.am index a1f8bd16f9..0a813f8d5d 100644 --- a/bash-completion/Makemodule.am +++ b/bash-completion/Makemodule.am @@ -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 diff --git a/bash-completion/irqtop b/bash-completion/irqtop new file mode 100644 index 0000000000..4a914b9c5d --- /dev/null +++ b/bash-completion/irqtop @@ -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