#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 "$@"