Add gitignore function

This commit is contained in:
Marty Oehme 2020-02-02 18:34:35 +01:00
parent 87308cbce9
commit 1684aaa50f
2 changed files with 61 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#compdef _gitignore gitignore
#
# Requires gitignore script in path
#
# Enables completion for zsh of gitignore function.
_gitignore_get_command_list() {
curl -sL https://www.gitignore.io/api/list | tr ',' '\n'
}
_gitignore() {
_arguments \
'1::flags:((-f\:"Save output to .gitignore file in current directory"))' \
":listopts: _values -s, 'modules' $(_gitignore_get_command_list)"
}