From 3954068128e1907521c19f09dca27068ce8c6945 Mon Sep 17 00:00:00 2001 From: Felipe Contreras Date: Sun, 15 Apr 2012 22:44:17 +0300 Subject: [PATCH] completion: simplify by using $prev cword-1 is the previous word ($prev). Signed-off-by: Felipe Contreras Signed-off-by: Junio C Hamano --- contrib/completion/git-completion.bash | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index db2d3cc3f..8c91faf1a 100755 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1658,7 +1658,7 @@ _git_notes () __gitcomp '--ref' ;; ,*) - case "${words[cword-1]}" in + case "$prev" in --ref) __gitcomp_nl "$(__git_refs)" ;; @@ -1684,7 +1684,7 @@ _git_notes () prune,*) ;; *) - case "${words[cword-1]}" in + case "$prev" in -m|-F) ;; *) -- 2.26.2