Current section

Files

Jump to
jacob lib jacob_cli templates installers bash_extension.eex
Raw

lib/jacob_cli/templates/installers/bash_extension.eex

# https://eli.thegreenplace.net/2013/12/26/adding-bash-completion-for-your-own-tools-an-example-for-pss
_<%= app_name %>_complete()
{
local type_list
# Ask <%= app_name %> to generate a list of commands it supports
type_list=`<%= app_name %> _autocomplete bash`
COMPREPLY=( $(compgen -W "${type_list}" -- ${2}) )
return 0
}
# Register _<%= app_name %>_complete to provide completion for the following commands
complete -F _<%= app_name %>_complete <%= app_name %>