浏览代码

gitfast: improve command aliases (#9385)

So that compdefs with dashes work as well as underscores:

  compdef _git gc=git_commit

Or:

  compdef _git gc=git-commit

The official Zsh Git completion uses dashes, and this way people don't
have to change their existing definitions.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
Felipe Contreras 4 年之前
父节点
当前提交
66f9fdabc1
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2 0
      plugins/gitfast/_git

+ 2 - 0
plugins/gitfast/_git

@@ -275,6 +275,8 @@ _git ()
 		emulate ksh -c __${service}_main
 		emulate ksh -c __${service}_main
 	elif (( $+functions[_${service}] )); then
 	elif (( $+functions[_${service}] )); then
 		emulate ksh -c _${service}
 		emulate ksh -c _${service}
+	elif ((	$+functions[_${service//-/_}] )); then
+		emulate ksh -c _${service//-/_}
 	fi
 	fi
 
 
 	let _ret && _default && _ret=0
 	let _ret && _default && _ret=0