diff options
author | Robby Russell <robby@planetargon.com> | 2013-07-23 07:24:58 -0700 |
---|---|---|
committer | Robby Russell <robby@planetargon.com> | 2013-07-23 07:24:58 -0700 |
commit | 5fcb6e1263e9fa7938e4ebfc03bf44aa624a5d7b (patch) | |
tree | 461fc3a9d6a4db4e2d586f422a3e5a7699d656f9 /plugins/mix | |
parent | dde7aefc6764d2f0d1bae9c35edf69cdad47f8bf (diff) | |
parent | 4b8e10958467899765e0e4fedb80d31f8e0adb8d (diff) | |
download | zsh-5fcb6e1263e9fa7938e4ebfc03bf44aa624a5d7b.tar.gz zsh-5fcb6e1263e9fa7938e4ebfc03bf44aa624a5d7b.tar.bz2 zsh-5fcb6e1263e9fa7938e4ebfc03bf44aa624a5d7b.zip |
Merge pull request #1988 from jwarwick/mix
Added autocompletion support for Elixir mix command
Diffstat (limited to 'plugins/mix')
-rw-r--r-- | plugins/mix/_mix | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/plugins/mix/_mix b/plugins/mix/_mix new file mode 100644 index 000000000..602f5ffa0 --- /dev/null +++ b/plugins/mix/_mix @@ -0,0 +1,63 @@ +#compdef mix +#autoload + +# Elixir mix zsh completion + +local -a _1st_arguments +_1st_arguments=( + 'archive:Archive this project into a .ez file' + 'clean:Clean generated application files' + 'compile:Compile source files' + 'deps:List dependencies and their status' + "deps.clean:Remove dependencies' files" + 'deps.compile:Compile dependencies' + 'deps.get:Get all out of date dependencies' + 'deps.unlock:Unlock the given dependencies' + 'deps.update:Update dependencies' + 'do:Executes the commands separated by comma' + 'escriptize:Generates an escript for the project' + 'help:Print help information for tasks' + 'local:List local tasks' + 'local.install:Install a task or an archive locally' + 'local.rebar:Install rebar locally' + 'local.uninstall:Uninstall local tasks or archives' + 'new:Creates a new Elixir project' + '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 + + 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) + + _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) + _arguments ':feature:__task_list' + esac + ;; +esac + |