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
This commit is contained in:
Alessandro Ghedini committed 2014-07-05 00:28:05 +02:00
1 parent 6cf2f634b3
commit 25a0709972
1 file changed
+9
+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;
}