_mix 1.67 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#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'
24
    'local.hex:Install Hex locally'
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
    '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