Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

PATCH: completion for the doage comic downloader


this is a completion function for the dosage comic downloader
(http://slipgate.za.net/dosage/) - the main binary is called

I'm currently using $words[1] to complete the comic names from the
output of the program to make it possible to use dosage without having
the mainline script in your path.

Greetings, Tobi

GPG-Key 0xE2BEA341 - signed/encrypted mail preferred
My, oh so small, homepage: http://portfolio16.de/
http://www.fli4l.de/ - ISDN- & DSL-Router on one disk!
Registered FLI4L-User #00000003
#compdef mainline
# zsh completion for the dosage webcomic downloader

_mainline () {
  _arguments -C -s \
    '(-h --help)'{-h,--help}'[show help message and exit]' \
    '*'{-v,--verbose}'[verbose output, use multiple times for more verbosity]' \
    '(-q --quiet)'{-q,--quiet}'[suppress all output]' \
    '*'{-c,--catch-up}'[retrieve comics up until the strip that already exists, use twice to retrieve all strips]' \
    '(-b --base-path)'{-b+,--base-path=}'[path for saved comics (default: Comics)]:path:_files -/' \
    '--base-url=[the base URL of your comics directory]:URL:_urls' \
    '(-l --list)'{-l,--list}'[list available comic modules]' \
    '--single-list[list available comic modules in a single list]' \
    '(-V --version)'{-V,--version}'[display the version number]' \
    '(-m --module-help)'{-m,--module-help}'[display help for comic modules]' \
    '(-t --timestamps)'{-t,--timestamps}'[print timestamps for all output]' \
    '(-o --output)'{-o+,--output=}'[output formatting for downloaded comics]:format:((text html rss))' \
    '(-p --progress)'{-p,--progress}'[display progress bar while downloading comics]' \

_dosage_comics () {
  if [[ ${+_dosage_comic_list} -eq 0 ]]; then
    _dosage_comic_list=(${${(f)"$(_call_program dosage-list $words[1] --single-list)"}[2,-2]})
  _wanted values expl "comics" _multi_parts -i "/" _dosage_comic_list

_mainline "$@"

Attachment: signature.asc
Description: Digital signature

Messages sorted by: Reverse Date, Date, Thread, Author