zsh-workers
 help / color / mirror / code / Atom feed
* PATCH: completion for the doage comic downloader
@ 2006-08-03 14:29 Tobias Gruetzmacher
  0 siblings, 0 replies; only message in thread
From: Tobias Gruetzmacher @ 2006-08-03 14:29 UTC (permalink / raw)
  To: Zsh hackers list


[-- Attachment #1.1: Type: text/plain, Size: 544 bytes --]

Hi,

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

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

[-- Attachment #1.2: _dosage --]
[-- Type: text/plain, Size: 1430 bytes --]

#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]' \
    "*:comics:_dosage_comics"
}

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

_mainline "$@"

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-08-03 14:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-08-03 14:29 PATCH: completion for the doage comic downloader Tobias Gruetzmacher

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).