# bash completion for rebar3 _rebar3() { local cur prev sopts lopts cmdsnvars COMPREPLY=() cur="${COMP_WORDS[COMP_CWORD]}" prev="${COMP_WORDS[COMP_CWORD-1]}" if [[ ${prev} == rebar3 ]] ; then sopts="-h -v" lopts="--help --version" cmdsnvars="as \ clean \ compile \ cover \ ct \ dialyzer \ do \ edoc \ escriptize \ eunit \ help \ new \ pkgs \ plugins \ release \ report \ shell \ tar \ unlock \ update \ upgrade \ version \ xref" elif [[ ${prev} == as ]] ; then : elif [[ ${prev} == clean ]] ; then sopts="-a" lopts="--all" elif [[ ${prev} == compile ]] ; then : elif [[ ${prev} == cover ]] ; then sopts="-r -v" lopts="--reset --verbose" elif [[ ${prev} == ct ]] ; then sopts="-c -v" lopts="--dir \ --suite \ --group \ --case \ --spec \ --join_specs \ --label \ --config \ --userconfig \ --allow_user_terms \ --logdir \ --logopts \ --verbosity \ --silent_connections \ --stylesheet \ --cover \ --cover_spec \ --cover_stop \ --event_handler \ --include \ --abort_if_missing_suites \ --multiply_timetraps \ --scale_timetraps \ --create_priv_dir \ --repeat \ --duration \ --until \ --force_stop \ --basic_html \ --ct_hooks \ --verbose" elif [[ ${prev} == dialyzer ]] ; then sopts="-u -s" lopts="--update-plt --succ-typings" elif [[ ${prev} == do ]] ; then : elif [[ ${prev} == edoc ]] ; then : elif [[ ${prev} == escriptize ]] ; then : elif [[ ${prev} == eunit ]] ; then sopts="-c -v" lopts="--app --cover --suite --verbose" elif [[ ${prev} == help ]] ; then : elif [[ ${prev} == new ]] ; then sopts="-f" lopts="--force" elif [[ ${prev} == pkgs ]] ; then : elif [[ ${prev} == plugins ]] ; then : elif [[ ${prev} == release ]] ; then sopts="-n -v -g -u -o -h -l -p -V -d -i -a -c -r" lopts="--relname \ --relvsn \ --goal \ --upfrom \ --output-dir \ --help \ --lib-dir \ --path \ --default-libs \ --verbose \ --dev-mode \ --include-erts \ --override \ --config \ --overlay_vars \ --vm_args \ --sys_config \ --system_libs \ --version \ --root" elif [[ ${prev} == report ]] ; then : elif [[ ${prev} == shell ]] ; then : elif [[ ${prev} == tar ]] ; then sopts="-n -v -g -u -o -h -l -p -V -d -i -a -c -r" lopts="--relname \ --relvsn \ --goal \ --upfrom \ --output-dir \ --help \ --lib-dir \ --path \ --default-libs \ --verbose \ --dev-mode \ --include-erts \ --override \ --config \ --overlay_vars \ --vm_args \ --sys_config \ --system_libs \ --version \ --root" elif [[ ${prev} == update ]] ; then : elif [[ ${prev} == upgrade ]] ; then : elif [[ ${prev} == version ]] ; then : elif [[ ${prev} == xref ]] ; then : fi COMPREPLY=( $(compgen -W "${sopts} ${lopts} ${cmdsnvars}" -- ${cur}) ) if [ -n "$COMPREPLY" ] ; then # append space if matched COMPREPLY="${COMPREPLY} " # remove trailing space after equal sign COMPREPLY=${COMPREPLY/%= /=} fi return 0 } complete -o nospace -F _rebar3 rebar3 # Local variables: # mode: shell-script # sh-basic-offset: 4 # sh-indent-comment: t # indent-tabs-mode: nil # End: # ex: ts=4 sw=4 et filetype=sh