burrow/burrow.d

30 lines
771 B
D
Raw Normal View History

2018-01-20 20:20:25 +00:00
#!/usr/bin/env bash
2018-01-20 20:02:34 +00:00
_burrow()
{
2018-01-20 20:20:25 +00:00
# Get basic autocomplete commands from the function itself
local helplist
helplist=$(burrow shortlist)
2018-01-20 20:02:34 +00:00
2018-01-20 20:20:25 +00:00
# Combine all the lists for autocomplete
local cur
cur=${COMP_WORDS[COMP_CWORD]}
COMPREPLY=( $( compgen -W "$helplist" -- "$cur" ) )
2018-01-20 20:02:34 +00:00
}
2018-03-03 23:24:05 +00:00
# Detect if current shell is ZSH, and if so, load this file in bash
# compatibility mode.
if [ -n "$ZSH_VERSION" ]; then
autoload bashcompinit
bashcompinit
fi
complete -o default -o nospace -F _burrow burrow
# The following are necessary only for Cygwin, and only are needed
# when the user has tab-completed the executable name and consequently
# included the '.exe' suffix.
if [ Cygwin = "$(uname -o 2>/dev/null)" ]; then
complete -o default -o nospace -F _burrow burrow.exe
fi