2021-02-24 18:45:56 +00:00
|
|
|
#compdef yt-dlp
|
2014-10-06 10:58:25 +00:00
|
|
|
|
2021-02-24 18:45:56 +00:00
|
|
|
__yt_dlp() {
|
2014-10-06 10:58:25 +00: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 16:09:12 +00:00
|
|
|
elif [[ ${prev} == "--remux-video" ]]; then
|
|
|
|
_arguments '*: :(mp4 mkv)'
|
2014-10-06 10:58:25 +00:00
|
|
|
elif [[ ${prev} == "--recode-video" ]]; then
|
|
|
|
_arguments '*: :(mp4 flv ogg webm mkv)'
|
|
|
|
else
|
|
|
|
_arguments '*: :({{flags}})'
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
2021-02-24 18:45:56 +00:00
|
|
|
__yt_dlp
|