diff --git a/.gitignore b/.gitignore index 3ac2577..94dfdd5 100644 --- a/.gitignore +++ b/.gitignore @@ -5,8 +5,8 @@ *.dll # *nix binaries -dcd-client -dcd-server +bin/dcd-client +bin/dcd-server *.o *.a *.so diff --git a/bash-completion/completions/dcd-client b/bash-completion/completions/dcd-client new file mode 100644 index 0000000..42e1768 --- /dev/null +++ b/bash-completion/completions/dcd-client @@ -0,0 +1,28 @@ +# Completion for dcd-client +_dcd_client() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="--help -h --cursorPos -c --shutdown --symbolLocation -l --doc -d\ + --search -s --query -q --status -I --version --port -p --tcp --socketFile" + if [[ ${cur} == -* ]]; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0; + fi + case "${prev}" in + "-I") + COMPREPLY=($(compgen -d ${cur})) + return 0 + ;; + "--socketFile") + COMPREPLY=($(compgen -f ${cur})) + return 0 + ;; + *) + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) +} +complete -F _dcd_client "dcd-client" diff --git a/bash-completion/completions/dcd-server b/bash-completion/completions/dcd-server new file mode 100755 index 0000000..feda84d --- /dev/null +++ b/bash-completion/completions/dcd-server @@ -0,0 +1,32 @@ +# Completion for dcd-server +_dcd_server() +{ + local cur prev opts + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + opts="-I --help -h --version --logLevel --tcp --socketFile" + logLevels="all trace info warning error critical fatal off" + if [[ ${cur} == -* ]]; then + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) + return 0; + fi + case "${prev}" in + "-I") + COMPREPLY=($(compgen -d ${cur})) + return 0 + ;; + "--logLevel") + COMPREPLY=($(compgen -W "${logLevels}" -- ${cur})) + return 0 + ;; + "--socketFile") + COMPREPLY=($(compgen -f ${cur})) + return 0 + ;; + *) + ;; + esac + COMPREPLY=($(compgen -W "${opts}" -- ${cur})) +} +complete -F _dcd_server "dcd-server"