diff options
author | Alessandro Ghedini <alessandro@ghedini.me> | 2014-06-29 17:26:14 -0400 |
---|---|---|
committer | Alessandro Ghedini <alessandro@ghedini.me> | 2014-07-05 00:28:05 +0200 |
commit | 25a07099725ae28c2ed898d299ca7439cdcd6d2b (patch) | |
tree | f969920e700ab9ec373cb9eb254c7956d42bc3a5 /TOOLS | |
parent | 6cf2f634b31b75d4082ce2dc4637b561312a5b39 (diff) | |
download | mpv-25a07099725ae28c2ed898d299ca7439cdcd6d2b.tar.bz2 mpv-25a07099725ae28c2ed898d299ca7439cdcd6d2b.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.
Conflicts:
TOOLS/zsh.pl
Diffstat (limited to 'TOOLS')
-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 59979015fe..67c0201440 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; } |