Bash completion script for mix

Bash completion is very handy for cli tools. You can set it up very easily for mix using the following script.

1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash
# `sudo vim /etc/bash_completion.d/mix.sh` and put this inside of it
# mix bash completion script

complete_mix_command() {
[ -f mix.exs ] || exit 0
mix help --search "$2"| cut -f1 -d'#' | cut -f2 -d' '
return $?
}

complete -C complete_mix_command -o default mix

I am currently working on LiveForm which makes setting up contact forms on your website a breeze.