]> git.phdru.name Git - dotfiles.git/commitdiff
.bash_completion: Add completion for `cgmem_nice`
authorOleg Broytman <phd@phdru.name>
Sat, 26 Oct 2019 23:52:43 +0000 (02:52 +0300)
committerOleg Broytman <phd@phdru.name>
Sat, 26 Oct 2019 23:52:43 +0000 (02:52 +0300)
.bash_completion.d/cgmem_nice [new file with mode: 0644]

diff --git a/.bash_completion.d/cgmem_nice b/.bash_completion.d/cgmem_nice
new file mode 100644 (file)
index 0000000..0b95294
--- /dev/null
@@ -0,0 +1,12 @@
+_cgmem_nice()
+{
+   local CUR=${COMP_WORDS[COMP_CWORD]}
+
+   if [ $COMP_CWORD -eq 1 ]; then
+      COMPREPLY=( $(compgen -W "100 200 300 500 1000 2000 4000" -- $CUR) )
+   elif [ $COMP_CWORD -ge 2 ]; then
+      _command_offset 2
+   fi
+}
+
+complete -F _cgmem_nice cgmem_nice