]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
irqtop: add bash-completion
authorSami Kerola <kerolasa@iki.fi>
Sat, 8 Feb 2020 16:28:52 +0000 (16:28 +0000)
committerSami Kerola <kerolasa@iki.fi>
Sat, 22 Feb 2020 21:43:54 +0000 (21:43 +0000)
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
bash-completion/Makemodule.am
bash-completion/irqtop [new file with mode: 0644]

index a1f8bd16f9cae1a492edb8a322cfcebf742b65cf..0a813f8d5dc13c4a72134e24e0eb7107240cfdff 100644 (file)
@@ -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 (file)
index 0000000..4a914b9
--- /dev/null
@@ -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