_mix 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. #compdef mix
  2. #autoload
  3. # Elixir mix zsh completion
  4. local -a _1st_arguments
  5. _1st_arguments=(
  6. 'app.start:Start all registered apps'
  7. 'archive:List all archives'
  8. 'archive.build:Archive this project into a .ez file'
  9. 'archive.install:Install an archive locally'
  10. 'archive.uninstall:Uninstall archives'
  11. 'clean:Delete generated application files'
  12. 'cmd:Executes the given command'
  13. 'compile:Compile source files'
  14. 'compile.protocols:Consolidates all protocols in all paths'
  15. 'deps:List dependencies and their status'
  16. "deps.clean:Remove the given dependencies' files"
  17. 'deps.compile:Compile dependencies'
  18. 'deps.get:Get all out of date dependencies'
  19. 'deps.unlock:Unlock the given dependencies'
  20. 'deps.update:Update the given dependencies'
  21. 'do:Executes the tasks separated by comma'
  22. 'escript.build:Builds an escript for the project'
  23. 'help:Print help information for tasks'
  24. 'hex:Print hex help information'
  25. 'hex.config:Read or update hex config'
  26. 'hex.docs:Publish docs for package'
  27. 'hex.info:Print hex information'
  28. 'hex.key:Hex API key tasks'
  29. 'hex.outdated:Shows outdated hex deps for the current project'
  30. 'hex.owner:Hex package ownership tasks'
  31. 'hex.publish:Publish a new package version'
  32. 'hex.search:Search for package names'
  33. 'hex.user:Hex user tasks'
  34. 'loadconfig:Loads and persists the given configuration'
  35. 'local:List local tasks'
  36. 'local.hex:Install hex locally'
  37. 'local.rebar:Install rebar locally'
  38. 'new:Create a new Elixir project'
  39. 'run:Run the given file or expression'
  40. "test:Run a project's tests"
  41. '--help:Describe available tasks'
  42. '--version:Prints the Elixir version information'
  43. )
  44. __task_list ()
  45. {
  46. local expl
  47. declare -a tasks
  48. tasks=(app.start archive archive.build archive.install archive.uninstall clean cmd compile compile.protocols deps deps.clean deps.compile deps.get deps.unlock deps.update do escript.build help hex hex.config hex.docs hex.info hex.key hex.outdated hex.owner hex.publish hex.search hex.user loadconfig local local.hex local.rebar new run test)
  49. _wanted tasks expl 'help' compadd $tasks
  50. }
  51. local expl
  52. local curcontext="$curcontext" state line
  53. typeset -A opt_args
  54. _arguments -C \
  55. ':command:->command' \
  56. '*::options:->options'
  57. case $state in
  58. (command)
  59. _describe -t commands "mix subcommand" _1st_arguments
  60. return
  61. ;;
  62. (options)
  63. case $line[1] in
  64. (help)
  65. _arguments ':feature:__task_list'
  66. esac
  67. ;;
  68. esac