Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bash completion working properly with colons in tasks names. #65

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions completion/bash
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,9 @@ function _grunt_gruntfile() {

# Enable bash autocompletion.
function _grunt_completions() {
# The currently-being-completed word.
local cur="${COMP_WORDS[COMP_CWORD]}"
# The currently-being-completed word with escaped colons
local cur
_get_comp_words_by_ref -n : cur
# The current gruntfile, if it exists.
local gruntfile="$(_grunt_gruntfile)"
# The current grunt version, available tasks, options, etc.
Expand All @@ -44,6 +45,8 @@ function _grunt_completions() {
[[ "$cur" == -* ]] && compls="$compls $opts"
# Tell complete what stuff to show.
COMPREPLY=($(compgen -W "$compls" -- "$cur"))
# clean input with colons
__ltrim_colon_completions "$cur"
}

complete -o default -F _grunt_completions grunt