X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=blobdiff_plain;f=src%2Fceph%2Fsrc%2Fbash_completion%2Fceph;fp=src%2Fceph%2Fsrc%2Fbash_completion%2Fceph;h=beec700e854c93e99fc41c76b1b0225d5bc50204;hb=812ff6ca9fcd3e629e49d4328905f33eee8ca3f5;hp=0000000000000000000000000000000000000000;hpb=15280273faafb77777eab341909a3f495cf248d9;p=stor4nfv.git diff --git a/src/ceph/src/bash_completion/ceph b/src/ceph/src/bash_completion/ceph new file mode 100644 index 0000000..beec700 --- /dev/null +++ b/src/ceph/src/bash_completion/ceph @@ -0,0 +1,50 @@ +# +# Ceph - scalable distributed file system +# +# This is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License version 2.1, as published by the Free Software +# Foundation. +# + +_ceph() +{ + local options_noarg="-h --help -s --status -w --watch --watch-debug --watch-info --watch-sec --watch-warn --watch-error --version -v --verbose --concise" + local options_arg="-c --conf -i --in-file -o --out-file --id --user -n --name --cluster --admin-daemon --admin-socket -f --format --connect-timeout" + local cnt=${#COMP_WORDS[@]} + local cur=${COMP_WORDS[COMP_CWORD]} + local prev=${COMP_WORDS[COMP_CWORD-1]} + + if [[ " -c --conf -i --in-file -o --out-file " =~ " ${prev} " ]] + then + #default autocomplete for options (file autocomplete) + compopt -o default + COMPREPLY=() + return 0 + fi + if [[ "${cur:0:1}" == "-" ]] ; + then + COMPREPLY=( $(compgen -W "${options_noarg} ${options_arg}" -- $cur) ) + return 0 + fi + declare -A hint_args + for (( i=1 ; i/dev/null) ) +} +complete -F _ceph ceph