1
0
mirror of https://github.com/mpv-player/mpv synced 2024-12-22 23:02:37 +00:00

TOOLS/zsh.pl: sort options in reverse order by length

This stops options that are prefixes of other options from blocking
completion of values for the longer ones.
This commit is contained in:
Alessandro Ghedini 2014-06-29 17:26:14 -04:00
parent e940afec15
commit 17d65f9aff

View File

@ -133,5 +133,14 @@ sub parse_opts {
push @list, $entry
}
if ($parsing_main_options) {
@list = sort {
$a =~ /(.*?)\:/; my $ma = $1;
$b =~ /(.*?)\:/; my $mb = $1;
length($mb) <=> length($ma)
} @list;
}
return @list;
}