Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

41 rader
1.2 KiB

  1. # bash completion for rebar
  2. _rebar()
  3. {
  4. local cur prev sopts lopts cmdsnvars
  5. COMPREPLY=()
  6. cur="${COMP_WORDS[COMP_CWORD]}"
  7. prev="${COMP_WORDS[COMP_CWORD-1]}"
  8. sopts="-h -c -v -V -f -j"
  9. lopts=" --help --commands --verbose --force --jobs= --version"
  10. cmdsnvars="check-deps clean compile create create-app create-node \
  11. ct doc delete-deps eunit get-deps generate generate-upgrade \
  12. help list-deps list-templates update-deps version xref overlay \
  13. case= force=1 jobs= suite= verbose=1 appid= previous_release= \
  14. skip_deps=true skip_app= template= template_dir="
  15. if [[ ${cur} == --* ]] ; then
  16. COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) )
  17. elif [[ ${cur} == -* ]] ; then
  18. COMPREPLY=( $(compgen -W "${sopts}" -- ${cur}) )
  19. else
  20. COMPREPLY=( $(compgen -W "${cmdsnvars}" -- ${cur}) )
  21. fi
  22. if [ -n "$COMPREPLY" ] ; then
  23. # append space if matched
  24. COMPREPLY="${COMPREPLY} "
  25. # remove trailing space after equal sign
  26. COMPREPLY=${COMPREPLY/%= /=}
  27. fi
  28. return 0
  29. }
  30. complete -o nospace -F _rebar rebar
  31. # Local variables:
  32. # mode: shell-script
  33. # sh-basic-offset: 4
  34. # sh-indent-comment: t
  35. # indent-tabs-mode: nil
  36. # End:
  37. # ex: ts=4 sw=4 et filetype=sh