mirror of
git://git.code.sf.net/p/zsh/code
synced 2024-11-20 05:53:52 +01:00
91 lines
2.7 KiB
Plaintext
91 lines
2.7 KiB
Plaintext
#compdef netscape
|
|
|
|
local curcontext="$curcontext" state line ret=1
|
|
typeset -A opt_args
|
|
|
|
_x_arguments -C \
|
|
'-xrm:resource:_x_resource' \
|
|
'-help[show usage message]' \
|
|
'-version[show the version number and build date]' \
|
|
'-visual[use a specific server visual]:id-or-number:' \
|
|
'-install[install a private colormap]' \
|
|
'-no-install[use the default colormap]' \
|
|
'-ncols[max no. of colors to allocate for images]:n:' \
|
|
'-mono[force 1-bit-deep image display]' \
|
|
'-iconic[start up iconified]' \
|
|
'-remote[execute a command in an existing Netscape]:remote command:->remote' \
|
|
'-id[id of X window to send remote commands to]:window-id:' \
|
|
'-raise[raise window following remote command]' \
|
|
"-noraise[don't raise window following remote command]" \
|
|
'-nethelp[show nethelp]' \
|
|
-{dont-force-window-stacking,no-about-splash} \
|
|
-{,no-}{,irix-}session-management \
|
|
-{done-save,ignore}-geometry-prefs \
|
|
-{component-bar,composer,edit,messenger,mail,discussions,news} \
|
|
'*:location:->urls' && ret=0
|
|
|
|
[[ "$state" = "urls" ]] &&
|
|
_files "$@" && return 0
|
|
|
|
|
|
# Handle netscape remote commands
|
|
if [[ "$state" = "remote" ]]; then
|
|
local -a remote_commands
|
|
remote_commands=(openURL openFile saveAs mailto addBookmark)
|
|
|
|
[[ $compstate[quoting] = (double|single) ]] && compset -q
|
|
compset -P '*\('
|
|
case $IPREFIX in
|
|
openURL*|addBookmark*) state=urls;;
|
|
openFile*) _files -W ~;;
|
|
saveAs*)
|
|
if compset -P "*,"; then
|
|
_wanted types expl 'data type' \
|
|
compadd -s")" -M 'm:{a-zA-Z}={A-Za-z}' HTML Text PostScript &&
|
|
ret=0
|
|
else
|
|
_files -W ~ && ret=0
|
|
fi
|
|
;;
|
|
mailto*)
|
|
compset -P "*,"
|
|
if compset -P '*@'; then
|
|
_wanted hosts expl 'remote host name' _hosts -q -S, && ret=0
|
|
else
|
|
_wanted users expl 'login name' _users -q -S@ && ret=0
|
|
fi
|
|
;;
|
|
*)
|
|
if _wanted commands; then
|
|
if [[ -z "$QIPREFIX" ]]; then
|
|
_all_labels commands expl 'remote commands' \
|
|
compadd -s'(' -S '' -M 'm:{a-zA-Z}={A-Za-z}' - \
|
|
$remote_commands && ret=0
|
|
else
|
|
_all_labels commands expl 'remote commands' \
|
|
compadd -qS '(' -M 'm:{a-zA-Z}={A-Za-z}' - \
|
|
$remote_commands && ret=0
|
|
fi
|
|
fi
|
|
;;
|
|
esac
|
|
fi
|
|
|
|
if [[ "$state" = "urls" ]]; then
|
|
# Complete netscape 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
|
|
else
|
|
if _wanted prefixes; then
|
|
while _next_label prefixes expl 'URL prefix'; do
|
|
compadd "$expl[@]" -S '' about: mocha: javascript: && ret=0
|
|
_urls "$@" && ret=0
|
|
done
|
|
fi
|
|
fi
|
|
fi
|
|
|
|
return ret
|