zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: Fix and enhance darcs completion
@ 2005-08-06 12:10 Tobias Gruetzmacher
  0 siblings, 0 replies; only message in thread
From: Tobias Gruetzmacher @ 2005-08-06 12:10 UTC (permalink / raw)
  To: zsh-workers

[-- Attachment #1: Type: text/plain, Size: 1513 bytes --]

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 #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2005-08-06 12:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-06 12:10 PATCH: Fix and enhance darcs completion Tobias Gruetzmacher

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).