_mix 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #compdef mix
  2. #autoload
  3. # Elixir mix zsh completion
  4. local -a _1st_arguments
  5. _1st_arguments=(
  6. 'archive:Archive this project into a .ez file'
  7. 'clean:Clean generated application files'
  8. 'compile:Compile source files'
  9. 'deps:List dependencies and their status'
  10. "deps.clean:Remove dependencies' files"
  11. 'deps.compile:Compile dependencies'
  12. 'deps.get:Get all out of date dependencies'
  13. 'deps.unlock:Unlock the given dependencies'
  14. 'deps.update:Update dependencies'
  15. 'do:Executes the commands separated by comma'
  16. 'escriptize:Generates an escript for the project'
  17. 'help:Print help information for tasks'
  18. 'local:List local tasks'
  19. 'local.install:Install a task or an archive locally'
  20. 'local.rebar:Install rebar locally'
  21. 'local.uninstall:Uninstall local tasks or archives'
  22. 'new:Creates a new Elixir project'
  23. 'run:Run the given file or expression'
  24. "test:Run a project's tests"
  25. '--help:Describe available tasks'
  26. '--version:Prints the Elixir version information'
  27. )
  28. __task_list ()
  29. {
  30. local expl
  31. declare -a tasks
  32. tasks=(archive clean compile deps deps.clean deps.compile deps.get deps.unlock deps.update do escriptize help local local.install local.rebar local.uninstall new run test)
  33. _wanted tasks expl 'help' compadd $tasks
  34. }
  35. local expl
  36. local curcontext="$curcontext" state line
  37. typeset -A opt_args
  38. _arguments -C \
  39. ':command:->command' \
  40. '*::options:->options'
  41. case $state in
  42. (command)
  43. _describe -t commands "mix subcommand" _1st_arguments
  44. return
  45. ;;
  46. (options)
  47. case $line[1] in
  48. (help)
  49. _arguments ':feature:__task_list'
  50. esac
  51. ;;
  52. esac