completion: simplify by using $prev
cword-1 is the previous word ($prev). Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
3bf421ea62
commit
3954068128
@ -1658,7 +1658,7 @@ _git_notes ()
|
|||||||
__gitcomp '--ref'
|
__gitcomp '--ref'
|
||||||
;;
|
;;
|
||||||
,*)
|
,*)
|
||||||
case "${words[cword-1]}" in
|
case "$prev" in
|
||||||
--ref)
|
--ref)
|
||||||
__gitcomp_nl "$(__git_refs)"
|
__gitcomp_nl "$(__git_refs)"
|
||||||
;;
|
;;
|
||||||
@ -1684,7 +1684,7 @@ _git_notes ()
|
|||||||
prune,*)
|
prune,*)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
case "${words[cword-1]}" in
|
case "$prev" in
|
||||||
-m|-F)
|
-m|-F)
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
Reference in New Issue
Block a user