about summary refs log tree commit diff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@users.sourceforge.net>2003-01-27 10:40:47 +0000
committerOliver Kiddle <opk@users.sourceforge.net>2003-01-27 10:40:47 +0000
commit8df030872c95122d58d83ffc16bf5e9290a6ff3b (patch)
tree64470a3789853329b8effc1e1ef6d4b72bc37994
parentabd18275a4c27bc76d26e5111b4cb9c33e2ae7d7 (diff)
downloadzsh-8df030872c95122d58d83ffc16bf5e9290a6ff3b.tar.gz
zsh-8df030872c95122d58d83ffc16bf5e9290a6ff3b.tar.xz
zsh-8df030872c95122d58d83ffc16bf5e9290a6ff3b.zip
Doug Kearns: 18141: new completion for elinks web browser
-rw-r--r--ChangeLog5
-rw-r--r--Completion/Unix/Command/.distfiles2
-rw-r--r--Completion/Unix/Command/_elinks42
3 files changed, 48 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 32db47896..82106e411 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2003-01-27  Oliver Kiddle  <opk@zsh.org>
+
+	* Doug Kearns: 18141: Completion/Unix/Command/_elinks:
+	new completion for elinks web browser
+
 2003-01-07  Oliver Kiddle  <opk@zsh.org>
 
 	* 18060: Completion/Zsh/Command/_zmv, Doc/Zsh/contrib.yo,
diff --git a/Completion/Unix/Command/.distfiles b/Completion/Unix/Command/.distfiles
index 0ba6f63db..979e430b7 100644
--- a/Completion/Unix/Command/.distfiles
+++ b/Completion/Unix/Command/.distfiles
@@ -18,5 +18,5 @@ _loadkeys     _apm          _ruby         _samba        _sysctl       _links
 _user_admin   _rsync        _arping	  _spamassassin _mtools	      _fsh
 _chkconfig    _cdcd         _irssi	  _sccs         _texinfo      _ant
 _global       _global_tags  _figlet       _ifconfig     _last         _larch
-_lsof         _mt           _xsltproc
+_lsof         _mt           _xsltproc     _elinks
 '
diff --git a/Completion/Unix/Command/_elinks b/Completion/Unix/Command/_elinks
new file mode 100644
index 000000000..fd10d7c39
--- /dev/null
+++ b/Completion/Unix/Command/_elinks
@@ -0,0 +1,42 @@
+#compdef elinks
+
+# ELinks 0.4.1 - Text WWW browser
+
+local curcontext="$curcontext" state line
+typeset -A opt_args
+
+_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:' \
+  '*-dump[Write formatted version of given URL to stdout]:boolean:(0 1)' \
+  '*-dump-charset[Codepage to use with -dump]:codepage:' \
+  '*-dump-width[Width of document formatted with -dump]:width:' \
+  '*-eval[Evaluate given configuration option]:configuration option:' \
+  '(- 1)-'{\?,h,help}'[Print usage help and exit]' \
+  '(- 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)' \
+  '*-session-ring[Connect to session ring with given ID]:ID number:' \
+  '*-source[Write the source of given URL to stdout]:boolean:(0 1)' \
+  '(1)*-stdin[Read document from stdin]:boolean:(0 1)' \
+  '*-touch-files[Touch files in ~/.elinks when running with -no-connect/-session-ring]:boolean:(0 1)' \
+  '(- 1)-version[Print version information and exit]' \
+  '1:url:->url' && return
+
+if [[ "$state" = url ]]; then
+  local elinks_bookmarks
+
+  if [[ -s ~/.elinks/bookmarks ]]; then
+    elinks_bookmarks=( $(cut -f2 ~/.elinks/bookmarks) )
+  fi
+
+  _alternative \
+    'files:file:_files' \
+    'bookmarks:bookmark:compadd -a elinks_bookmarks' \
+    'urls:url:_urls' && return
+fi
+
+return 1