From 29b047da6fd504329117c680cd8fd4ff53f587c8 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Mon, 30 Jun 2014 20:42:00 -0400 Subject: TOOLS/zsh.pl: complete URL schemes based on --list-protocols --- TOOLS/zsh.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'TOOLS/zsh.pl') diff --git a/TOOLS/zsh.pl b/TOOLS/zsh.pl index 572c2dc040..15c181f5f1 100755 --- a/TOOLS/zsh.pl +++ b/TOOLS/zsh.pl @@ -15,7 +15,9 @@ my @vo = parse_opts("$mpv --vo=help", '^ ([^\s\:]*)\s*: (.*)'); my @af = parse_opts("$mpv --af=help", '^ ([^\s\:]*)\s*: (.*)'); my @vf = parse_opts("$mpv --vf=help", '^ ([^\s\:]*)\s*: (.*)'); -my ($opts_str, $ao_str, $vo_str, $af_str, $vf_str); +my @protos = parse_opts("$mpv --list-protocols", '^ ([^\s]*)'); + +my ($opts_str, $ao_str, $vo_str, $af_str, $vf_str, $protos_str); $opts_str .= qq{ '$_' \\\n} foreach (@opts); chomp $opts_str; @@ -32,6 +34,9 @@ chomp $af_str; $vf_str .= qq{ '$_' \\\n} foreach (@vf); chomp $vf_str; +$protos_str .= qq{$_ } foreach (@protos); +chomp $protos_str; + my $tmpl = <<"EOS"; #compdef mpv @@ -86,7 +91,7 @@ $vf_str if _requested urls; then while _next_label urls expl URL; do _urls "\$expl[@]" && ret=0 - compadd -S '' "\$expl[@]" \{dvd,vcd,cdda,cddb,tv\}:// && ret=0 + compadd -S '' "\$expl[@]" $protos_str && ret=0 done fi (( ret )) || return 0 -- cgit v1.2.3