diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2014-06-29 17:26:14 -0400 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2014-07-03 11:03:56 +0200 |
commit | 17d65f9aff29864368cc2c9becbd0ce4cbfac409 (patch) | |
tree | 9489343326ec978b71e9e7834aa4ca6ab864a39e | |
parent | e940afec158c262b05ad9b9f15292e3a61826c33 (diff) | |
download | mpv-17d65f9aff29864368cc2c9becbd0ce4cbfac409.tar.bz2 mpv-17d65f9aff29864368cc2c9becbd0ce4cbfac409.tar.xz |
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.
-rwxr-xr-x | TOOLS/zsh.pl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/TOOLS/zsh.pl b/TOOLS/zsh.pl index 03d8bda6bd..572c2dc040 100755 --- a/TOOLS/zsh.pl +++ b/TOOLS/zsh.pl @@ -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; } |