_mix 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. 'local.hex:Install Hex locally'
  23. 'new:Creates a new Elixir project'
  24. 'run:Run the given file or expression'
  25. "test:Run a project's tests"
  26. '--help:Describe available tasks'
  27. '--version:Prints the Elixir version information'
  28. )
  29. __task_list ()
  30. {
  31. local expl
  32. declare -a tasks
  33. 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)
  34. _wanted tasks expl 'help' compadd $tasks
  35. }
  36. local expl
  37. local curcontext="$curcontext" state line
  38. typeset -A opt_args
  39. _arguments -C \
  40. ':command:->command' \
  41. '*::options:->options'
  42. case $state in
  43. (command)
  44. _describe -t commands "mix subcommand" _1st_arguments
  45. return
  46. ;;
  47. (options)
  48. case $line[1] in
  49. (help)
  50. _arguments ':feature:__task_list'
  51. esac
  52. ;;
  53. esac