From 33368b57aa077ac13448f4d4927dd8a77934f763 Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Fri, 11 Nov 2022 13:33:16 -0800 Subject: pds: manpage, shell completions --- extra/adenosine-pds.bash_completions | 277 +++++++++++++++++++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 extra/adenosine-pds.bash_completions (limited to 'extra/adenosine-pds.bash_completions') diff --git a/extra/adenosine-pds.bash_completions b/extra/adenosine-pds.bash_completions new file mode 100644 index 0000000..608179d --- /dev/null +++ b/extra/adenosine-pds.bash_completions @@ -0,0 +1,277 @@ +_adenosine() { + local i cur prev opts cmds + COMPREPLY=() + cur="${COMP_WORDS[COMP_CWORD]}" + prev="${COMP_WORDS[COMP_CWORD-1]}" + cmd="" + opts="" + + for i in ${COMP_WORDS[@]} + do + case "${i}" in + adenosine) + cmd="adenosine" + ;; + + generate-secret) + cmd+="__generate__secret" + ;; + help) + cmd+="__help" + ;; + import) + cmd+="__import" + ;; + inspect) + cmd+="__inspect" + ;; + register) + cmd+="__register" + ;; + serve) + cmd+="__serve" + ;; + *) + ;; + esac + done + + case "${cmd}" in + adenosine) + opts=" -v -h -V --verbose --help --version --block-db --atp-db --shell-completions serve import inspect generate-secret register help" + if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + + --block-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --atp-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --shell-completions) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + + adenosine__generate__secret) + opts=" -h -V -v --help --version --verbose --block-db --atp-db " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + + --block-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --atp-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + adenosine__help) + opts=" -h -V -v --help --version --verbose --block-db --atp-db " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + + --block-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --atp-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + adenosine__import) + opts=" -h -V -v --help --version --verbose --alias --block-db --atp-db " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + + --alias) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --block-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --atp-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + adenosine__inspect) + opts=" -h -V -v --help --version --verbose --block-db --atp-db " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + + --block-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --atp-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + adenosine__register) + opts=" -d -V -v -h -p -e -r --did-plc --help --version --verbose --pds-secret-key --public-url --handle --password --email --recovery-key --block-db --atp-db " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + + --pds-secret-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --public-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --handle) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -h) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --password) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -p) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --email) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -e) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --recovery-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + -r) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --block-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --atp-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + adenosine__serve) + opts=" -h -V -v --help --version --verbose --pds-secret-key --port --public-url --registration-domain --invite-code --homepage-handle --block-db --atp-db " + if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + fi + case "${prev}" in + + --pds-secret-key) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --port) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --public-url) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --registration-domain) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --invite-code) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --homepage-handle) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --block-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + --atp-db) + COMPREPLY=($(compgen -f "${cur}")) + return 0 + ;; + *) + COMPREPLY=() + ;; + esac + COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") ) + return 0 + ;; + esac +} + +complete -F _adenosine -o bashdefault -o default adenosine -- cgit v1.2.3