MOON
Server: Apache/2.2.34 (Unix) mod_ssl/2.2.34 OpenSSL/0.9.8e-fips-rhel5 mod_bwlimited/1.4 FrontPage/5.0.2.2635
System: Linux server.asjudinet.com 2.6.32-042stab141.3 #1 SMP Fri Nov 15 22:45:34 MSK 2019 i686
User: asjudine (504)
PHP: 5.2.17
Disabled: NONE
Upload Files
File: //proc/self/root/usr/share/zsh/4.2.6/functions/_defaults
#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
}

_defaults_keys(){
  local ks="$(_call_program keys defaults read "$words[2]" 2>/dev/null | sed '/^    [[:alpha:]"]/ { s/^    //; s/ = .*$//; p;}; d')"
  local expl
  _wanted keys expl 'key' compadd ${(f)ks}
}

_defaults(){
  local -a _1st_arguments
  _1st_arguments=( read read-type write rename delete domains find help )

  local curcontext="$curcontext" state line expl

  _arguments -A '-*' \
    '(-currentHost)-host:host:_hosts' \
    '(-host)-currentHost' \
    '*::command:->subcmd' && return 0

  if (( CURRENT == 1 )); then
    _describe -t commands "command" _1st_arguments
    return
  fi

  case $words[1] in
    read|read-type|delete)
      _arguments \
        "(1)-app:application:_mac_applications" \
        "(-app)1:domain:_defaults_domains" \
        "2:keys:_defaults_keys"
      ;;
    write)
      _arguments \
        "(1)-app:application:_mac_applications" \
        "(-app)1:domain:_defaults_domains" \
        "2:key:_defaults_keys" \
        "*::value"
      ;;
    rename)
      _arguments \
        "(1)-app:application:_mac_applications" \
        "(-app)1:domain:_defaults_domains" \
        "2:old key:_defaults_keys" \
        "3:new key:_defaults_keys"
      ;;
    domains|help)
      ;;
    find)
      _message word
      ;;
    *)
      _message "unknown defaults command: $words[1]"
      ;;
  esac
}

_defaults "$@"