2015-04-30 13:03:31 +02:00
|
|
|
#compdef mix
|
2013-07-20 05:19:11 +02:00
|
|
|
#autoload
|
|
|
|
|
|
|
|
# Elixir mix zsh completion
|
|
|
|
|
|
|
|
local -a _1st_arguments
|
|
|
|
_1st_arguments=(
|
2015-04-30 13:03:31 +02:00
|
|
|
'app.start:Start all registered apps'
|
|
|
|
'archive:List all archives'
|
|
|
|
'archive.build:Archive this project into a .ez file'
|
|
|
|
'archive.install:Install an archive locally'
|
|
|
|
'archive.uninstall:Uninstall archives'
|
|
|
|
'clean:Delete generated application files'
|
|
|
|
'cmd:Executes the given command'
|
2013-07-20 05:19:11 +02:00
|
|
|
'compile:Compile source files'
|
2015-04-30 13:03:31 +02:00
|
|
|
'compile.protocols:Consolidates all protocols in all paths'
|
2013-07-20 05:19:11 +02:00
|
|
|
'deps:List dependencies and their status'
|
2015-04-30 13:03:31 +02:00
|
|
|
"deps.clean:Remove the given dependencies' files"
|
2013-07-20 05:19:11 +02:00
|
|
|
'deps.compile:Compile dependencies'
|
|
|
|
'deps.get:Get all out of date dependencies'
|
|
|
|
'deps.unlock:Unlock the given dependencies'
|
2015-04-30 13:03:31 +02:00
|
|
|
'deps.update:Update the given dependencies'
|
|
|
|
'do:Executes the tasks separated by comma'
|
|
|
|
'escript.build:Builds an escript for the project'
|
2013-07-20 05:19:11 +02:00
|
|
|
'help:Print help information for tasks'
|
2015-04-30 13:03:31 +02:00
|
|
|
'hex:Print hex help information'
|
|
|
|
'hex.config:Read or update hex config'
|
|
|
|
'hex.docs:Publish docs for package'
|
|
|
|
'hex.info:Print hex information'
|
|
|
|
'hex.key:Hex API key tasks'
|
|
|
|
'hex.outdated:Shows outdated hex deps for the current project'
|
|
|
|
'hex.owner:Hex package ownership tasks'
|
|
|
|
'hex.publish:Publish a new package version'
|
|
|
|
'hex.search:Search for package names'
|
|
|
|
'hex.user:Hex user tasks'
|
|
|
|
'loadconfig:Loads and persists the given configuration'
|
2013-07-20 05:19:11 +02:00
|
|
|
'local:List local tasks'
|
2015-04-30 13:03:31 +02:00
|
|
|
'local.hex:Install hex locally'
|
2013-07-20 05:19:11 +02:00
|
|
|
'local.rebar:Install rebar locally'
|
2015-04-30 13:03:31 +02:00
|
|
|
'new:Create a new Elixir project'
|
2013-07-20 05:19:11 +02:00
|
|
|
'run:Run the given file or expression'
|
|
|
|
"test:Run a project's tests"
|
|
|
|
'--help:Describe available tasks'
|
|
|
|
'--version:Prints the Elixir version information'
|
|
|
|
)
|
|
|
|
|
|
|
|
__task_list ()
|
|
|
|
{
|
|
|
|
local expl
|
|
|
|
declare -a tasks
|
|
|
|
|
2015-04-30 13:03:31 +02:00
|
|
|
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)
|
2013-07-20 05:19:11 +02:00
|
|
|
|
|
|
|
_wanted tasks expl 'help' compadd $tasks
|
|
|
|
}
|
|
|
|
|
|
|
|
local expl
|
|
|
|
|
|
|
|
local curcontext="$curcontext" state line
|
|
|
|
typeset -A opt_args
|
|
|
|
|
|
|
|
_arguments -C \
|
|
|
|
':command:->command' \
|
|
|
|
'*::options:->options'
|
|
|
|
|
|
|
|
case $state in
|
|
|
|
(command)
|
|
|
|
_describe -t commands "mix subcommand" _1st_arguments
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
|
|
|
|
(options)
|
|
|
|
case $line[1] in
|
|
|
|
(help)
|
2015-04-30 13:03:31 +02:00
|
|
|
_arguments ':feature:__task_list'
|
2016-04-20 17:09:52 +02:00
|
|
|
;;
|
|
|
|
(test)
|
|
|
|
_files
|
|
|
|
;;
|
2013-07-20 05:19:11 +02:00
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|