選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

42 行
1.3 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 ct \
  11. doc delete-deps escriptize eunit get-deps generate generate-upgrade \
  12. help list-deps list-templates qc update-deps version xref overlay \
  13. apps= case= force=1 jobs= suites= verbose=1 appid= \
  14. previous_release= nodeid= root_dir= skip_deps=true skip_apps= \
  15. template= template_dir="
  16. if [[ ${cur} == --* ]] ; then
  17. COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) )
  18. elif [[ ${cur} == -* ]] ; then
  19. COMPREPLY=( $(compgen -W "${sopts}" -- ${cur}) )
  20. else
  21. COMPREPLY=( $(compgen -W "${cmdsnvars}" -- ${cur}) )
  22. fi
  23. if [ -n "$COMPREPLY" ] ; then
  24. # append space if matched
  25. COMPREPLY="${COMPREPLY} "
  26. # remove trailing space after equal sign
  27. COMPREPLY=${COMPREPLY/%= /=}
  28. fi
  29. return 0
  30. }
  31. complete -o nospace -F _rebar rebar
  32. # Local variables:
  33. # mode: shell-script
  34. # sh-basic-offset: 4
  35. # sh-indent-comment: t
  36. # indent-tabs-mode: nil
  37. # End:
  38. # ex: ts=4 sw=4 et filetype=sh