From 17d65f9aff29864368cc2c9becbd0ce4cbfac409 Mon Sep 17 00:00:00 2001 From: Alessandro Ghedini Date: Sun, 29 Jun 2014 17:26:14 -0400 Subject: 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. --- TOOLS/zsh.pl | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'TOOLS/zsh.pl') 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; } -- cgit v1.2.3