Skip to content

Instantly share code, notes, and snippets.

@Baccata
Created March 2, 2018 08:07
Show Gist options
  • Save Baccata/e7354351379b6cf8ade49f7d71b53ea7 to your computer and use it in GitHub Desktop.
Save Baccata/e7354351379b6cf8ade49f7d71b53ea7 to your computer and use it in GitHub Desktop.
Very basic bash autocompletion support for mill
# See https://debian-administration.org/article/317/An_introduction_to_bash_completion_part_2
__mill()
{
local cur prev opts
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
opts="$(echo $(mill resolve __ 2>/dev/null ) | sed 's/ / /g')"
COMPREPLY=( $(compgen -W "${opts}" -- ${cur}) )
return 0
}
complete -F __mill mill
@Baccata
Copy link
Author

Baccata commented Mar 2, 2018

Just source it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment