浏览代码

fix: include symlinks when autocompleting gimmes

Kyle Davis 6 年之前
父节点
当前提交
5224c828f8
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      gimme

+ 2 - 2
gimme

@@ -76,14 +76,14 @@ if [[ "$0" =~ [-]?bash ]]; then # sourced or piped
 
 	if [[ "${BASH_SOURCE[@]}" ]]; then # sourced
 
+		# setup autocompletion for gimmes
 		_gimme_completely() {
 			if [[ "$2" = -* ]]; then
 				COMPREPLY=( $(compgen -W "-v --verbose --debug --force --version --help -l --list --installed --old --outdated" -- "$2") )
 			else
-				COMPREPLY=( $(find "$GIMME_GIMMES_DIR" -type f -path "$GIMME_GIMMES_DIR/$2*" \! -name '.*' | cut -c$(( ${#GIMME_GIMMES_DIR} + 2))- ) )
+				COMPREPLY=( $(cd "$GIMME_GIMMES_DIR"; find . -path "./$2*" \! -type d \! -name '.*' \! -name '_*' | cut -c3- ) )
 			fi
 		}
-
 		complete -F _gimme_completely gimme
 
 	else # piped