2018-05-22 14:55:34 +02:00
|
|
|
#compdef zathura
|
|
|
|
|
|
|
|
local -a all_opts
|
|
|
|
all_opts=(
|
2019-10-26 00:15:36 +02:00
|
|
|
'(-c --config-dir)'{-c,--config-dir=}'[specify path to config directory]:config directory:_files -/'
|
|
|
|
'(-d --data-dir)'{-d,--data-dir=}'[specify path to data directory]:data directory:_files -/'
|
|
|
|
'--cache-dir=[specify path to cache directory]:cache directory:_files -/'
|
|
|
|
'(-p --plugins-dir)'{-p,--plugins-dir=}'[specify path to plugins directory]:plugins directory:_files -/'
|
|
|
|
'(-e --reparent)'{-e,--reparent=}'[reparent to window specified by XID (X11)]: :_x_window'
|
|
|
|
'(-w --password)'{-w,--password=}'[specify a password for the document]:password'
|
|
|
|
'(-P --page)'{-p,--page=}'[open the document at the given page number]:page number'
|
|
|
|
'(-l --log-level)'{-l,--log-level=}'[set log level]:level:(error warning info debug)'
|
2019-12-21 17:43:06 +01:00
|
|
|
'(-x --synctex-editor-command)'{-x,--synctex-editor-command=}'[specify synctex editor (forwarded to the synctex command)]:command'
|
2019-10-26 00:15:36 +02:00
|
|
|
'--synctex-forward=[move to the given position]:position'
|
|
|
|
'--synctex-pid=[highlight position in given process]:pid:_pids'
|
|
|
|
'--mode[start in a non-default mode]:mode:(presentation fullscreen)'
|
|
|
|
'--fork[fork into the background]'
|
|
|
|
'(- :)'{-h,--help}'[show help message]'
|
|
|
|
'(- :)'{-v,--version}'[print version information]'
|
2018-05-22 14:55:34 +02:00
|
|
|
'*:file:->files'
|
|
|
|
)
|
|
|
|
|
2019-10-26 00:15:36 +02:00
|
|
|
local curcontext="$curcontext" state state_descr line ret=1
|
2018-05-22 14:55:34 +02:00
|
|
|
typeset -A opt_args
|
2019-10-26 00:15:36 +02:00
|
|
|
_arguments -C -s -S "$all_opts[@]" && ret=0
|
2018-05-22 14:55:34 +02:00
|
|
|
|
2019-10-26 00:15:36 +02:00
|
|
|
local PLUGIN
|
|
|
|
local -a exts
|
2018-05-22 14:55:34 +02:00
|
|
|
for PLUGIN in @PLUGINDIR@/lib*.so; do
|
|
|
|
case ${PLUGIN##*/} in
|
|
|
|
libpdf-poppler.so)
|
2019-10-26 00:15:36 +02:00
|
|
|
exts+=( pdf PDF )
|
2018-05-22 14:55:34 +02:00
|
|
|
;;
|
|
|
|
libpdf-mupdf.so)
|
2019-10-26 00:15:36 +02:00
|
|
|
exts+=( pdf PDF epub oxps )
|
2018-05-22 14:55:34 +02:00
|
|
|
;;
|
|
|
|
libps.so)
|
2019-10-26 00:15:36 +02:00
|
|
|
exts+=( ps eps epsi epsf )
|
2018-05-22 14:55:34 +02:00
|
|
|
;;
|
|
|
|
libdjvu.so)
|
2019-10-26 00:15:36 +02:00
|
|
|
exts+=( djvu djv )
|
2018-05-22 14:55:34 +02:00
|
|
|
;;
|
|
|
|
libcb.so)
|
2019-10-26 00:15:36 +02:00
|
|
|
exts+=( cb7 cbr cbz cbt rar zip 7z tar )
|
2018-05-22 14:55:34 +02:00
|
|
|
;;
|
2019-02-03 15:27:21 +01:00
|
|
|
esac
|
2018-05-22 14:55:34 +02:00
|
|
|
done
|
|
|
|
|
|
|
|
case $state in
|
|
|
|
(files)
|
2019-10-26 00:15:36 +02:00
|
|
|
_wanted files expl file _files -g "*.(${(j:|:)exts:-pdf})(-.)" && ret=0
|
2018-05-22 14:55:34 +02:00
|
|
|
;;
|
|
|
|
esac
|
2019-10-26 00:15:36 +02:00
|
|
|
|
|
|
|
return ret
|