|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161 |
- _gutenberg() {
- 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
- gutenberg)
- cmd="gutenberg"
- ;;
-
- build)
- cmd+="__build"
- ;;
- help)
- cmd+="__help"
- ;;
- init)
- cmd+="__init"
- ;;
- serve)
- cmd+="__serve"
- ;;
- *)
- ;;
- esac
- done
-
- case "${cmd}" in
- gutenberg)
- opts=" -c -h -V --config --help --version init build serve help"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- fi
- case "${prev}" in
-
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
-
- gutenberg__build)
- opts=" -h -V -u -o --help --version --base-url --output-dir "
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- fi
- case "${prev}" in
-
- --base-url)
- COMPREPLY=("<base_url>")
- return 0
- ;;
- -u)
- COMPREPLY=("<base_url>")
- return 0
- ;;
- --output-dir)
- COMPREPLY=("<output_dir>")
- return 0
- ;;
- -o)
- COMPREPLY=("<output_dir>")
- return 0
- ;;
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- gutenberg__help)
- opts=" -h -V --help --version "
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- fi
- case "${prev}" in
-
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- gutenberg__init)
- opts=" -h -V --help --version <name> "
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- fi
- case "${prev}" in
-
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- gutenberg__serve)
- opts=" -h -V -i -p -o -u --help --version --interface --port --output-dir --base-url "
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- fi
- case "${prev}" in
-
- --interface)
- COMPREPLY=("<interface>")
- return 0
- ;;
- -i)
- COMPREPLY=("<interface>")
- return 0
- ;;
- --port)
- COMPREPLY=("<port>")
- return 0
- ;;
- -p)
- COMPREPLY=("<port>")
- return 0
- ;;
- --output-dir)
- COMPREPLY=("<output_dir>")
- return 0
- ;;
- -o)
- COMPREPLY=("<output_dir>")
- return 0
- ;;
- --base-url)
- COMPREPLY=("<base_url>")
- return 0
- ;;
- -u)
- COMPREPLY=("<base_url>")
- return 0
- ;;
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
- return 0
- ;;
- esac
- }
-
- complete -F _gutenberg -o bashdefault -o default gutenberg
|