You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
939 B

  1. # bash completion for rebar
  2. #have rebar &&
  3. _rebar()
  4. {
  5. local cur prev opts
  6. COMPREPLY=()
  7. cur="${COMP_WORDS[COMP_CWORD]}"
  8. prev="${COMP_WORDS[COMP_CWORD-1]}"
  9. sopts="-h -v -f -j"
  10. lopts=" --help --verbose --force --jobs="
  11. cmdsnvars="analyze build_plt clean compile create-app \
  12. create-app create-node eunit generate \
  13. int_test perf_test test \
  14. case= force=1 jobs= suite= verbose=1"
  15. if [[ ${cur} == --* ]] ; then
  16. COMPREPLY=( $(compgen -W "${lopts}" -- ${cur}) )
  17. return 0
  18. elif [[ ${cur} == -* ]] ; then
  19. COMPREPLY=( $(compgen -W "${sopts}" -- ${cur}) )
  20. return 0
  21. else
  22. COMPREPLY=( $(compgen -W "${cmdsnvars}" -- ${cur}) )
  23. return 0
  24. fi
  25. }
  26. complete -F _rebar rebar
  27. # Local variables:
  28. # mode: shell-script
  29. # sh-basic-offset: 4
  30. # sh-indent-comment: t
  31. # indent-tabs-mode: nil
  32. # End:
  33. # ex: ts=4 sw=4 et filetype=sh