* PATCH: update elinks completer
@ 2010-06-22 0:46 Doug Kearns
0 siblings, 0 replies; only message in thread
From: Doug Kearns @ 2010-06-22 0:46 UTC (permalink / raw)
To: zsh-workers
This is an update for 0.12pre5.
Regards,
Doug
Index: Completion/Unix/Command/_elinks
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Unix/Command/_elinks,v
retrieving revision 1.9
diff -u -r1.9 _elinks
--- Completion/Unix/Command/_elinks 26 Jul 2004 16:59:54 -0000 1.9
+++ Completion/Unix/Command/_elinks 22 Jun 2010 00:01:12 -0000
@@ -1,6 +1,6 @@
#compdef elinks
-# ELinks 0.9.0 - Text WWW browser
+# ELinks 0.12pre5
local curcontext="$curcontext" state line ret=1
typeset -A opt_args
@@ -8,40 +8,55 @@
_arguments -C -A '-*' \
'*-anonymous[restrict to anonymous mode]::boolean:(0 1)' \
'*-auto-submit[autosubmit first form]::boolean:(0 1)' \
- '*-base-session[clone session with given ID]:ID number:' \
- '*-confdir[set config dir to given string]:configuration directory:_files -/' \
- '*-conffile[configuration file name]:configuration file:_files' \
- '*-default-mime-type[MIME type to assume for documents]:MIME type:_mime_types' \
- '*-dump[write formatted version of given URL to stdout]::boolean:(0 1)' \
+ '*-base-session[clone internal session with given ID]:ID number:' \
+ '*-config-dir[name of directory with configuration file]:configuration directory:_files -/' \
+ '(- 1)-config-dump[print default configuration file to stdout]' \
+ '*-config-file[name of configuration file]:configuration file:_files' \
+ '*-default-mime-type[MIME type assumed for unknown document types]:MIME type:_mime_types' \
+ '*-default-keys[ignore user-defined keybindings]::boolean:(0 1)' \
+ '*-dump[print formatted versions of given URLs to stdout]::boolean:(0 1)' \
'*-dump-charset[codepage to use with -dump]:codepage:' \
+ '-dump-color-mode[color mode used with -dump]:color mode:((-1\:standard\ dump\ mode 0\:mono\ mode 1\:16\ color\ mode 2\:88\ color\ mode 3\:256\ color\ mode 4\:true\ color\ mode))' \
'*-dump-width[width of document formatted with -dump]:width:' \
- '*-eval[evaluate given configuration option]:configuration option:' \
- '*-force-html[assume the file is HTML]' \
+ '*-eval[evaluate configuration file directive]:configuration option:' \
+ '*-force-html[interpret documents of unknown types as HTML]' \
'(- 1)-'{\?,h,help}'[print usage help and exit]' \
+ '*-localhost[only permit local connections]::boolean:(0 1)' \
'(- 1)-long-help[print detailed usage help and exit]' \
'(- 1)-config-help[print help for configuration options]' \
'(- 1)-lookup[look up specified host]:host:_hosts' \
'*-no-connect[run as separate instance]::boolean:(0 1)' \
"*-no-home[don't use files in ~/.elinks]::boolean:(0 1)" \
+ '*-no-numbering[disable link numbering in dump output]::boolean:(0 1)' \
+ '*-no-references[disable printing of link references in dump output]::boolean:(0 1)' \
+ '*-remote[control an already running ELinks]:*:command:->remote' \
'*-session-ring[connect to session ring with given ID]:ID number:' \
- '*-source[write the source of given URL to stdout]::boolean:(0 1)' \
+ '*-source[print the source of given URLs to stdout]::boolean:(0 1)' \
'(1)*-stdin[read document from stdin]::boolean:(0 1)' \
- '*-no-numbering[do not number links in dump output]::boolean:(0 1)' \
'*-touch-files[touch files in ~/.elinks when running with -no-connect/-session-ring]::boolean:(0 1)' \
+ '*-verbose[verbose level]:verbosity level:((0\:serious\ errors 1\:serious\ errors\ and\ warnings 2\:all\ messages ))' \
'(- 1)-version[print version information and exit]' \
'1:URL:->url' && ret=0
if [[ "$state" = url ]]; then
- local elinks_bookmarks
+ local -a bookmarks
+ local file=${opt_args[-config-dir]:-${ELINKS_CONFDIR:-~/.elinks}}/bookmarks
- if [[ -s ~/.elinks/bookmarks ]]; then
- elinks_bookmarks=( $(cut -f2 ~/.elinks/bookmarks) )
+ if [[ -s $file ]]; then
+ bookmarks=( ${${${(f)"$(< $file)"}#* }%% *} )
fi
_alternative \
'files:file:_files' \
- 'bookmarks:bookmark:compadd -a elinks_bookmarks' \
- 'urls:URL:_urls' && return
+ 'bookmarks:bookmark:compadd -a bookmarks' \
+ 'urls:URL:_urls' && ret=0
+elif [[ "$state" = remote ]]; then
+ local -a commands
+ commands=( ping openURL addBookmark infoBox xfeDoCommand )
+
+ _alternative \
+ 'commands:command:compadd -a commands' \
+ 'urls:URL:_urls' && ret=0
fi
return ret
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-06-22 0:46 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-22 0:46 PATCH: update elinks completer Doug Kearns
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).