you-get/contrib/completion/_you-get
Zhiming Wang 3b4a576e6c
Add shell completion definitions for Bash, Fish and Zsh
Paths of completion definitions in this repo are inconsequential, and I
don't know a convention for that, so I just modelled it on git.git
https://github.com/git/git/tree/master/contrib/completion. What's
different here is that instead of using a uniform naming scheme for each
file (you-get-completion.<shellname>), I'm using the conventional name
for each shell, which means _you-get for Zsh, for instance. Users of
each shell should be able to pick out the completion definition for
their shell based on the filenames; in the worst case, they can still
tell from the comment at the top of each file.

Note that I'm no expert on Bash or Fish completion, so
you-get-completion.bash and you-get.fish may not be written in the
idiomatic way. (you-get-completion.bash is most certainly not idiomatic,
if there's an idiom at all.)

Closes #1178.
2016-05-28 18:50:50 -07:00

30 lines
1.5 KiB
Plaintext

#compdef you-get
# Zsh completion definition for soimort/you-get.
setopt localoptions noshwordsplit noksharrays
local -a args
args=(
'(- : *)'{-V,--version}'[print version and exit]'
'(- : *)'{-h,--help}'[print help and exit]'
'(-i --info)'{-i,--info}'[print extracted information]'
'(-u --url)'{-u,--url}'[print extracted information with URLs]'
'(--json)--json[print extracted URLs in JSON format]'
'(-n --no-merge)'{-n,--no-merge}'[do not merge video parts]'
'(--no-caption)--no-caption[do not download captions]'
'(-f --force)'{-f,--force}'[force overwrite existing files]'
'(-F --format)'{-F,--format}'[set video format to the specified stream id]:stream id'
'(-O --output-filename)'{-O,--output-filename}'[set output filename]:filename:_files'
'(-o --output-dir)'{-o,--output-dir}'[set output directory]:directory:_files -/'
'(-p --player)'{-p,--player}'[stream extracted URL to the specified player]:player and options'
'(-c --cookies)'{-c,--cookies}'[load cookies.txt or cookies.sqlite]:cookies file:_files'
'(-x --http-proxy)'{-x,--http-proxy}'[use the specified HTTP proxy for downloading]:host\:port:'
'(-y --extractor-proxy)'{-y,--extractor-proxy}'[use the specified HTTP proxy for extraction only]:host\:port'
'(--no-proxy)--no-proxy[do not use a proxy]'
'(-t --timeout)'{-t,--timeout}'[set socket timeout]:seconds'
'(-d --debug)'{-d,--debug}'[show traceback and other debug info]'
'*: :_guard "^-*" url'
)
_arguments -S -s $args