mirror of
https://github.com/OpenNebula/one.git
synced 2026-12-01 20:56:42 +09:00
M #: Add bash completion to onecfg (#4692)
This commit is contained in:
1 parent
5f449153ae
commit
e897aac3d2
1 file changed
+22
@@ -194,6 +194,28 @@ _onebackupjob() {
|
||||
fi
|
||||
}
|
||||
|
||||
_onecfg() {
|
||||
local cur prev opts
|
||||
COMPREPLY=()
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||
opts="patch generate init status validate upgrade diff"
|
||||
if [ "$COMP_CWORD" == 1 ]; then
|
||||
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
|
||||
return 0
|
||||
elif [ "$COMP_CWORD" == 2 ]; then
|
||||
case "$prev" in
|
||||
patch|generate)
|
||||
_one_complete_files "$cur"
|
||||
return 0
|
||||
;;
|
||||
esac
|
||||
elif [ "$COMP_CWORD" == 5 ] && [ "${COMP_WORDS[1]}" == generate ]; then
|
||||
_one_complete_files "$cur"
|
||||
return 0
|
||||
fi
|
||||
}
|
||||
|
||||
_onecluster() {
|
||||
local cur prev opts cmd
|
||||
COMPREPLY=()
|
||||
|
||||
Reference in new issue
Block a user