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-07-03 11:03:56 +02:00
parent e940afec15
commit 17d65f9aff
+9
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;
}