Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: Fix and enhance darcs completion



Hi,

here is a fix for the darcs completion (it didn't list all repositories
that it should) and also added the posibility to complete repositories
in options that use them (darcs changes --repo=URL for example).

--- orig/Completion/Unix/Command/_darcs
+++ mod/Completion/Unix/Command/_darcs
@@ -69,6 +69,8 @@
 	  action[i]='_users' ;;
 	EMAIL|FROM)
 	  action[i]='_email_addresses' ;;
+	URL)
+	  action[i]='_darcs_repository_or_tree' ;;
 	*)
  	  action[i]='' ;;
  	esac
@@ -252,11 +254,8 @@
     local local_repos_path="$(_darcs_absolute_tree_root)/_darcs/prefs/repos"
     local global_repos_path="$HOME/.darcs/repos"
     local -a local_repos global_repos
-    local -a global_repos
-    [[ -e $local_repos_path ]] && cat $local_repos_path | read -A local_repos
-    [[ -e $global_repos_path ]] && cat $global_repos_path | read -A global_repos
-    local_repos=${local_repos:# #}
-    global_repos=${global_repos:# #}
+    [[ -e $local_repos_path ]] && local_repos=($(<$local_repos_path))
+    [[ -e $global_repos_path ]] && global_repos=($(<$global_repos_path))
     _description repositories expl "repositories"
     (( ${#local_repos} )) && compadd "$expl[@]" -- "$local_repos[@]"
     (( ${#global_repos} )) && compadd "$expl[@]" -- "$global_repos[@]"


Greetings Tobi

-- 
GPG-Key 0xE2BEA341 - signed/encrypted mail preferred
My, oh so small, homepage: http://portfolio16.de/
http://www.fli4l.de/ - ISDN- & DSL-Router on one disk!
registered FLI4L-User #00000003

Attachment: signature.asc
Description: Digital signature



Messages sorted by: Reverse Date, Date, Thread, Author