I noticed a request for a bash auto-completion script on the Fossil
Wiki (https://www.sqlite.org/debug1/wiki?name=Auto-completion) --
adding the following code to your bash $HOME/.bashrc file should do
the trick (I've also introduced the alias 'f' for 'fossil' to cut down
on keystrokes):
8<----------------------------------------------
# Command name completion for Fossil.
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
alias f='fossil'
8<----------------------------------------------
Cheers, Stuart
_______________________________________________
fossil-users mailing list
[email protected]
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users