Last active
February 14, 2017 08:27
-
-
Save wojtuss/e5b8a276382c12cad0989ff0d88af88d to your computer and use it in GitHub Desktop.
pmempool bash auto-complete
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A script for pmempool command auto-completion in bash. | |
# Put it into /etc/bash_completion.d directory and load it by running | |
# . /etc/bash_completion.d/pmempool | |
_pmempool() | |
{ | |
local cur prev opts | |
COMPREPLY=() | |
cur="${COMP_WORDS[COMP_CWORD]}" | |
prev="${COMP_WORDS[COMP_CWORD-1]}" | |
opts="info create dump check rm convert sync transform" | |
opts_h="$opts help" | |
case "${prev}" in | |
info) | |
;& | |
create) | |
;& | |
dump) | |
;& | |
check) | |
;& | |
rm) | |
;& | |
convert) | |
;& | |
sync) | |
;& | |
transform) | |
_filedir | |
return 0 | |
;; | |
help) | |
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) ) | |
return 0 | |
;; | |
*) | |
;; | |
esac | |
COMPREPLY=( $(compgen -W "${opts_h}" -- ${cur}) ) | |
return 0 | |
} | |
complete -F _pmempool pmempool |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment