about summary refs log tree commit diff
path: root/Completion/Darwin/Command
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2005-01-17 09:39:17 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2005-01-17 09:39:17 +0000
commit1735ba79183b2d301b92ffb143ed638dfb428821 (patch)
treeec1a364c7394b9ad3f6400f02f5e67572ca120e4 /Completion/Darwin/Command
parent7c2424d02224be21bed940af7249060736e8cc83 (diff)
downloadzsh-1735ba79183b2d301b92ffb143ed638dfb428821.tar.gz
zsh-1735ba79183b2d301b92ffb143ed638dfb428821.tar.xz
zsh-1735ba79183b2d301b92ffb143ed638dfb428821.zip
Motoi Washida: users/8380: complete plist files
Diffstat (limited to 'Completion/Darwin/Command')
-rw-r--r--Completion/Darwin/Command/_defaults16
1 files changed, 10 insertions, 6 deletions
diff --git a/Completion/Darwin/Command/_defaults b/Completion/Darwin/Command/_defaults
index 0c17c9e69..8723c605f 100644
--- a/Completion/Darwin/Command/_defaults
+++ b/Completion/Darwin/Command/_defaults
@@ -1,12 +1,16 @@
 #compdef defaults
 
 _defaults_domains(){
-  local str="$(_call_program domains defaults domains 2>/dev/null)"
-  local expl
-  local -a list
-  list=( ${(s/, /)str} -g -globalDomain )
-  _wanted domains expl 'defaults database domain' \
-      compadd -M 'r:|.=* r:|=*' -a list
+  if [[ "`eval echo $PREFIX`" != [/~]* ]]; then
+    local str="$(_call_program domains defaults domains 2>/dev/null)"
+    local expl
+    local -a list
+    list=( ${(s/, /)str} -g -globalDomain )
+    _wanted domains expl 'defaults database domain' \
+	compadd -M 'r:|.=* r:|=*' -a list
+  else
+    _files -g '*.plist(e:"reply=\${REPLY%.plist}":)'
+  fi
 }
 
 _defaults_keys(){