diff --git a/lib/completely/template.erb b/lib/completely/template.erb index de2c095..565a09b 100644 --- a/lib/completely/template.erb +++ b/lib/completely/template.erb @@ -1,9 +1,12 @@ -#!/usr/bin/env bash +# Bash completion script -*- shell-script -*- # This bash completions script was generated by # completely (https://github.com/dannyben/completely) # Modifying it manually is not recommended + <%= function_name %>() { + _init_completion -s || return + local cur=${COMP_WORDS[COMP_CWORD]} local comp_line="${COMP_WORDS[@]:1}" @@ -13,6 +16,6 @@ '<%= pattern.text_without_prefix %>'*) COMPREPLY=($(compgen <%= pattern.compgen %> -- "$cur")) ;; % end esac -} +} && complete -F <%= function_name %> -o bashdefault -o default <%= command %> -complete -F <%= function_name %> <%= command %> +# ex: filetype=sh