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

40 行
1.1 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 -v -f -j"
  9. lopts=" --help --verbose --force --jobs="
  10. cmdsnvars="analyze build_plt check_plt clean compile \
  11. create-app create-node eunit generate \
  12. int_test perf_test test \
  13. case= force=1 jobs= suite= verbose=1 appid="
  14. if [[ ${cur} == --* ]] ; then
  15. COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) )
  16. elif [[ ${cur} == -* ]] ; then
  17. COMPREPLY=( $(compgen -W "${sopts}" -- ${cur}) )
  18. else
  19. COMPREPLY=( $(compgen -W "${cmdsnvars}" -- ${cur}) )
  20. fi
  21. if [ -n "$COMPREPLY" ] ; then
  22. # append space if matched
  23. COMPREPLY="${COMPREPLY} "
  24. # remove trailing space after equal sign
  25. COMPREPLY=${COMPREPLY/%= /=}
  26. fi
  27. return 0
  28. }
  29. complete -o nospace -F _rebar rebar
  30. # Local variables:
  31. # mode: shell-script
  32. # sh-basic-offset: 4
  33. # sh-indent-comment: t
  34. # indent-tabs-mode: nil
  35. # End:
  36. # ex: ts=4 sw=4 et filetype=sh