diff options
| author | cashmere <cashmere@autistici.org> | 2026-09-04 09:05:24 +0200 |
|---|---|---|
| committer | cashmere <cashmere@autistici.org> | 2026-09-04 09:05:24 +0200 |
| commit | 4f49b16079b27d7ce633619e4cddfdf2bffbc952 (patch) | |
| tree | c296c1e7f3c3e2f6859c6d3a1b1b208779b89679 /tools/fossil-autocomplete.bash | |
| download | relic-master.tar.gz | |
Diffstat (limited to 'tools/fossil-autocomplete.bash')
| -rwxr-xr-x | tools/fossil-autocomplete.bash | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tools/fossil-autocomplete.bash b/tools/fossil-autocomplete.bash new file mode 100755 index 0000000..c2af0dd --- /dev/null +++ b/tools/fossil-autocomplete.bash @@ -0,0 +1,15 @@ +# Command name completion for Fossil. +# Mailing-list contribution by Stuart Rackham. +function _fossil() { + local cur commands + cur=${COMP_WORDS[COMP_CWORD]} + commands=$(fossil help --all) + if [ $COMP_CWORD -eq 1 ] || [ ${COMP_WORDS[1]} = help ]; then + # Command name completion for 1st argument or 2nd if help command. + COMPREPLY=( $(compgen -W "$commands" $cur) ) + else + # File name completion for other arguments. + COMPREPLY=( $(compgen -f $cur{}) ) + fi +} +complete -o default -F _fossil fossil f |
