summary refs log tree commit diff
path: root/Completion/Unix/Command/_elinks
blob: c76d3f64e62ea04b9d3601118b9e86923676925f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#compdef elinks

# ELinks 0.9.0 - 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:' \
  '*-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:' \
  '*-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:' \
  '*-force-html[assume the file is HTML]' \
  '(- 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)' \
  '*-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)' \
  '(- 1)-version[print version information and exit]' \
  '1:url:->url' && ret=0

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 ret