#compdef peertube-viewer-rs

autoload -U is-at-least

_peertube-viewer-rs() {
    typeset -A opt_args
    typeset -a _arguments_options
    local ret=1

    if is-at-least 5.2; then
        _arguments_options=(-s -S -C)
    else
        _arguments_options=(-s -C)
    fi

    local context curcontext="$curcontext" state line
    _arguments "${_arguments_options[@]}" : \
'(--channels)--chandle=[Start browsing the videos of a channel with its handle (ex\: name@instance.com)]: :_default' \
'*--player-args=[Arguments to be passed to the player]: :_default' \
'-p+[Player to play the videos with]: :_default' \
'--player=[Player to play the videos with]: :_default' \
'--torrent-downloader=[Choose the torrent software to download the videos with]: :_default' \
'*--torrent-downloader-args=[Arguments to be passed to the torrent downloader]: :_default' \
'-i+[Instance to be browsed]: :_default' \
'--instance=[Instance to be browsed]: :_default' \
'(-i --instance)--search-engine=[Use a search engine (like sepiasearch)]: :_default' \
'-c+[Sets a custom config file]: :_default' \
'--config=[Sets a custom config file]: :_default' \
'--use-raw-urls[The raw url to the video will be passed to the player instead of the url to web interface to watch it. It may be necessary for players without native support for peertube such as vlc. Some players (ex \: mpv) may be able to show the video title in their interface if this option isn'\''t used]' \
'(--print-full-example-config)--print-default-config[Print the default confing to stdout and exit]' \
'--print-full-example-config[Print an example of all possible config options and exit]' \
'-s[When playing a video with this option, the user will be prompted to chose the video quality  Note\: this implies --use-raw-urls]' \
'--select-quality[When playing a video with this option, the user will be prompted to chose the video quality  Note\: this implies --use-raw-urls]' \
'--local[Only browse video hosted on the instance you are connected to]' \
'(--use-raw-urls)--use-torrent[Will download the video via the torrent downloader instead of playing it]' \
'(--chandle)-t[Will start browsing trending videos]' \
'(--chandle)--trending[Will start browsing trending videos]' \
'(-t --trending)--channels[Will start searching video channels]' \
'(--tag-nsfw)--let-nsfw[Don'\''t tag nsfw results]' \
'(--block-nsfw)--tag-nsfw[Tag nsfw results. This is the default behavior. This flag is only useful to override the config file]' \
'(--let-nsfw)--block-nsfw[Block nsfw search results]' \
'--no-color[Remove coloring of output]' \
'--color[Force coloring of output if it is disabled in the config file]' \
'-V[Print version]' \
'--version[Print version]' \
'::initial-query -- Initial query to be searched.
If it is a url, it will try to play it as a video:_default' \
&& ret=0
}

(( $+functions[_peertube-viewer-rs_commands] )) ||
_peertube-viewer-rs_commands() {
    local commands; commands=()
    _describe -t commands 'peertube-viewer-rs commands' commands "$@"
}

if [ "$funcstack[1]" = "_peertube-viewer-rs" ]; then
    _peertube-viewer-rs "$@"
else
    compdef _peertube-viewer-rs peertube-viewer-rs
fi
