about summary refs log tree commit diff
diff options
context:
space:
mode:
authorClint Adams <clint@users.sourceforge.net>2001-12-11 20:24:02 +0000
committerClint Adams <clint@users.sourceforge.net>2001-12-11 20:24:02 +0000
commit9e16ce5584b1486cd9720c2bdb3d8e5e7c7b7eb0 (patch)
tree27e42ff5d5cb6e781f9d1a9db9a766c362dd2393
parent16ad1217f00ffb190a949bf0560d9a8d6cd1f7db (diff)
downloadzsh-9e16ce5584b1486cd9720c2bdb3d8e5e7c7b7eb0.tar.gz
zsh-9e16ce5584b1486cd9720c2bdb3d8e5e7c7b7eb0.tar.xz
zsh-9e16ce5584b1486cd9720c2bdb3d8e5e7c7b7eb0.zip
oops
-rw-r--r--Completion/Unix/Command/_rsync5
-rw-r--r--_mozilla99
2 files changed, 104 insertions, 0 deletions
diff --git a/Completion/Unix/Command/_rsync b/Completion/Unix/Command/_rsync
new file mode 100644
index 000000000..cb0261340
--- /dev/null
+++ b/Completion/Unix/Command/_rsync
@@ -0,0 +1,5 @@
+#compdef rsync
+
+_arguments -- '*=COMMAND*:command:_command' \
+              '*=FILE*:file:_files' \
+              '*=DIR*:directory:_files -/'
diff --git a/_mozilla b/_mozilla
new file mode 100644
index 000000000..30cfe8dc9
--- /dev/null
+++ b/_mozilla
@@ -0,0 +1,99 @@
+#compdef mozilla
+
+local curcontext="$curcontext" state line ret=1 suf
+typeset -A opt_args
+
+_x_arguments -C \
+  '-height[height of startup window]:height:' \
+  '(-h)-help[show usage message]' \
+  '(-help)-h[show usage message]' \
+  '-installer[start with 4.x migration window]' \
+  '-width[width of startup window]:width:' \
+  '(-v)-version[show the version number and build date]' \
+  '(-version)-v[show the version number and build date]' \
+  '-CreateProfile:profile:' \
+  '-P[start with profile]:profile:' \
+  '-ProfileWizard[start with profile wizard]' \
+  '-ProfileManager[start with profile manager]' \
+  '-SelectProfile[start with profile selection dialog]' \
+  '-UILocale:locale:' \
+  '-contentLocale:locale:' \
+  '-remote[execute a command in an existing Mozilla]:remote command:->remote' \
+  '-splash[enable splash screen]' \
+  '-chat[start with IRC client]' \
+  '-news[start with news]' \
+  '-jsconsole[start with JavaScript Console]' \
+  '-venkman[start with JavaScript debugger]' \
+  '-terminal[start with command line terminal]' \
+  '-edit[start with editor]:url:_urls' \
+  '-chrome[load the specified chrome]:url:_urls' \
+  '-mail[start with mail]' \
+  '-compose[start with messenger compose]:url:_urls' \
+  '*:location:->urls' && ret=0
+
+[[ "$state" = "urls" ]] &&
+  _files "$@" && return 0
+
+# Handle mozilla remote commands
+if [[ "$state" = "remote" ]]; then  
+  local -a remote_commands
+  remote_commands=(openURL openFile saveAs mailto addBookmark)
+
+  compset -P '*\('
+  if compset -S '(|\\)\)*'; then
+    set - -S "" "$@"
+  else
+    set - -S"${${QIPREFIX:+)}:-\)}$compstate[quote] " "$@"
+  fi
+  case $IPREFIX in
+    openURL*|addBookmark*) state=urls;;
+    openFile*) _files "$@" -W ~;;
+    saveAs*) 
+      if compset -P "*,"; then
+        _wanted types expl 'data type' \
+            compadd "$@" -M 'm:{a-zA-Z}={A-Za-z}' HTML Text PostScript && ret=0
+      else
+        compset -S ",*" || suf=","
+        _files -qS "$suf" -W ~ && ret=0
+      fi
+    ;;
+    mailto*)
+      compset -P "*,"
+      if compset -P '*@'; then
+        _wanted hosts expl 'remote host name' _hosts -q -S, && ret=0
+      else
+        compset -S "@*" || suf="@"
+        _wanted users expl 'login name' _users -q -S "$suf" && ret=0
+      fi
+    ;;
+    *)
+      compset -S '(|\\)\(*' || suf="${${QIPREFIX:+(}:-\(}"
+      _wanted commands expl 'remote commands' \
+          compadd -qS "$suf" -M 'm:{a-zA-Z}={A-Za-z}' -a \
+                  remote_commands && ret=0
+    ;;
+  esac
+fi
+
+if [[ "$state" = "urls" ]]; then
+  # Complete mozilla urls
+  if compset -P about: ; then
+    _wanted values expl 'about what' \
+        compadd "$@" authors blank cache document fonts global hype image-cache \
+            license logo memory-cache mozilla plugins && ret=0
+  elif compset -P news: ; then
+    _newsgroups "$@" && ret=0
+  else
+    _tags prefixes
+    while _tags; do
+      while _next_label prefixes expl 'URL prefix' "$@"; do
+        _urls "$expl[@]" && ret=0
+	compset -S '[^:]*'
+        compadd -S '' "$expl[@]" about: news: mocha: javascript: && ret=0
+      done
+      (( ret )) || return 0
+    done
+  fi
+fi
+
+return ret