Fossil SCM

fossil-scm / tools / fossil-autocomplete.bash
Blame History Raw 16 lines
1
# Command name completion for Fossil.
2
# Mailing-list contribution by Stuart Rackham.
3
function _fossil() {
4
local cur commands
5
cur=${COMP_WORDS[COMP_CWORD]}
6
commands=$(fossil help --all)
7
if [ $COMP_CWORD -eq 1 ] || [ ${COMP_WORDS[1]} = help ]; then
8
# Command name completion for 1st argument or 2nd if help command.
9
COMPREPLY=( $(compgen -W "$commands" $cur) )
10
else
11
# File name completion for other arguments.
12
COMPREPLY=( $(compgen -f $cur{}) )
13
fi
14
}
15
complete -o default -F _fossil fossil f
16

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button