mirror of
https://github.com/sstent/vmimages.git
synced 2026-01-25 14:41:44 +00:00
sync
This commit is contained in:
48
dotfiles/sstent/mr_completion.bash
Normal file
48
dotfiles/sstent/mr_completion.bash
Normal file
@@ -0,0 +1,48 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
_mr_completion() {
|
||||
local cur prev opts
|
||||
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
flags="--directory --config --force --force-env --verbose --minimal --quiet --insecure --stats --interactive --no-recurse --jobs --cache --cached --uncache --top --trust-all"
|
||||
|
||||
case "${prev}" in
|
||||
mr)
|
||||
opts="checkout update status clean commit record fetch push diff log grep run bootstrap register config action online offline remember"
|
||||
COMPREPLY=( $(compgen -W "${flags} ${opts}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
clean|commit|record|grep|run|bootstrap|register|config|action|remember)
|
||||
case "${prev}" in
|
||||
clean)
|
||||
opts="-f"
|
||||
;;
|
||||
commit|record)
|
||||
opts='-m -a'
|
||||
;;
|
||||
run)
|
||||
opts='<command> [param ...]'
|
||||
;;
|
||||
bootstrap)
|
||||
opts='src [directory]'
|
||||
;;
|
||||
config)
|
||||
opts='section ["setting=[value]" ...]'
|
||||
;;
|
||||
*)
|
||||
opts=""
|
||||
;;
|
||||
esac
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
return 0
|
||||
}
|
||||
|
||||
complete -F _mr_completion mr
|
||||
Reference in New Issue
Block a user