2021-02-24 19:45:56 +01:00
|
|
|
#compdef yt-dlp
|
2014-10-06 12:58:25 +02:00
|
|
|
|
2021-02-24 19:45:56 +01:00
|
|
|
__yt_dlp() {
|
2014-10-06 12:58:25 +02:00
|
|
|
local curcontext="$curcontext" fileopts diropts cur prev
|
|
|
|
typeset -A opt_args
|
|
|
|
fileopts="{{fileopts}}"
|
|
|
|
diropts="{{diropts}}"
|
|
|
|
cur=$words[CURRENT]
|
|
|
|
case $cur in
|
|
|
|
:)
|
|
|
|
_arguments '*: :(::ytfavorites ::ytrecommended ::ytsubscriptions ::ytwatchlater ::ythistory)'
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
prev=$words[CURRENT-1]
|
|
|
|
if [[ ${prev} =~ ${fileopts} ]]; then
|
|
|
|
_path_files
|
|
|
|
elif [[ ${prev} =~ ${diropts} ]]; then
|
|
|
|
_path_files -/
|
2020-05-16 18:09:12 +02:00
|
|
|
elif [[ ${prev} == "--remux-video" ]]; then
|
|
|
|
_arguments '*: :(mp4 mkv)'
|
2014-10-06 12:58:25 +02:00
|
|
|
elif [[ ${prev} == "--recode-video" ]]; then
|
|
|
|
_arguments '*: :(mp4 flv ogg webm mkv)'
|
|
|
|
else
|
|
|
|
_arguments '*: :({{flags}})'
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2021-02-24 19:45:56 +01:00
|
|
|
__yt_dlp
|