Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.

42 righe
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="analyze build_plt check_plt check-deps clean compile \
  11. create create-app create-node doc delete-deps eunit \
  12. get-deps generate help int_test perf_test test \
  13. version xref \
  14. case= force=1 jobs= suite= verbose=1 appid= template= \
  15. skip_deps=1"
  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