about summary refs log tree commit diff
path: root/Completion/Unix/Command
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2005-08-08 07:59:36 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2005-08-08 07:59:36 +0000
commitb1aa9f874e35194612e53e47d0b0b6261069fb89 (patch)
tree75cfd59a507d63a6d81f77b6d69167da0504741f /Completion/Unix/Command
parent20866bf154711e64e6f97936cf8e0055a7fc8917 (diff)
downloadzsh-b1aa9f874e35194612e53e47d0b0b6261069fb89.tar.gz
zsh-b1aa9f874e35194612e53e47d0b0b6261069fb89.tar.xz
zsh-b1aa9f874e35194612e53e47d0b0b6261069fb89.zip
21566: Tobias Gruetzmacher: fix to list all repositories
Diffstat (limited to 'Completion/Unix/Command')
-rw-r--r--Completion/Unix/Command/_darcs21
1 files changed, 10 insertions, 11 deletions
diff --git a/Completion/Unix/Command/_darcs b/Completion/Unix/Command/_darcs
index 543aca97e..6d590585d 100644
--- a/Completion/Unix/Command/_darcs
+++ b/Completion/Unix/Command/_darcs
@@ -69,6 +69,8 @@ if (( CURRENT > 2 )); then
 	  action[i]='_users' ;;
 	EMAIL|FROM)
 	  action[i]='_email_addresses' ;;
+	URL)
+	  action[i]='_darcs_repository_or_tree' ;;
 	*)
  	  action[i]='' ;;
  	esac
@@ -249,17 +251,14 @@ _darcs_controlled_files() {
 
 (( $+functions[_darcs_repositories] )) ||
 _darcs_repositories() {
-    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:# #}
-    _description repositories expl "repositories"
-    (( ${#local_repos} )) && compadd "$expl[@]" -- "$local_repos[@]"
-    (( ${#global_repos} )) && compadd "$expl[@]" -- "$global_repos[@]"
+  local local_repos_path="$(_darcs_absolute_tree_root)/_darcs/prefs/repos"
+  local global_repos_path="$HOME/.darcs/repos"
+  local -a local_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[@]"
 }