mirror of
https://github.com/mpv-player/mpv
synced 2025-01-08 16:10:29 +00:00
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:
parent
e940afec15
commit
17d65f9aff
@ -133,5 +133,14 @@ sub parse_opts {
|
|||||||
push @list, $entry
|
push @list, $entry
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($parsing_main_options) {
|
||||||
|
@list = sort {
|
||||||
|
$a =~ /(.*?)\:/; my $ma = $1;
|
||||||
|
$b =~ /(.*?)\:/; my $mb = $1;
|
||||||
|
|
||||||
|
length($mb) <=> length($ma)
|
||||||
|
} @list;
|
||||||
|
}
|
||||||
|
|
||||||
return @list;
|
return @list;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user