diff options
Diffstat (limited to 'community/fossil/bash.completion')
-rwxr-xr-x | community/fossil/bash.completion | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/community/fossil/bash.completion b/community/fossil/bash.completion new file mode 100755 index 000000000..63bb9f15b --- /dev/null +++ b/community/fossil/bash.completion @@ -0,0 +1,33 @@ +_fossil() +{ +local cur prev opts + +#Var used by BASH +COMPREPLY=() +#word we are trying to complete +cur="${COMP_WORDS[COMP_CWORD]}" +#word before the one we're trying to complete +prev="${COMP_WORDS[COMP_CWORD-1]}" +#list of word that fossil know +opts="add addremove all annotate bisect branch cat changes checkout " +opts="$opts ci clean clone close co commit delete diff export extras " +opts="$opts finfo gdiff help import info init ls merge mv new open " +opts="$opts pull push rebuild remote-url revert rm settings sqlite3 " +opts="$opts stash status sync tag timeline ui undo unset update version" + +case "${prev}" in +add) opts="--dotfiles --ignore" ;; +addremove) opts="--dotfiles --ignore --test" ;; +all) opts="list ls pull push rebuild sync" ;; +annotate) opts="--limit --log --filevers" ;; +bisect) opts="bad good next options reset vlist" ;; +branch) opts="list ls -R --repository" ;; +merge) opts="--nochange -n --force -f --detail" +esac + +compopt -o filenames +COMPREPLY=($(compgen -fW "${opts}" -- "${cur}") \ +$(compgen -d -- "$cur")) +} + +complete -F _fossil fossil |