summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Darwin/Command/_defaults16
2 files changed, 15 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 3077e8f17..2f893602a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2005-01-17  Oliver Kiddle  <opk@zsh.org>
+
+	* Motoi Washida: users/8380: Completion/Darwin/Command/_defaults:
+	complete plist files
+
 2005-01-16  Clint Adams  <clint@zsh.org>
 
 	* 20718: Src/Zle/zle_utils.c: minor cleanup for proto-Unicode
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(){