1
0
mirror of https://github.com/mpv-player/mpv synced 2025-02-17 04:58:06 +00:00

TOOLS/zsh.pl: untabify

This commit is contained in:
Philip Sequeira 2014-06-29 17:24:27 -04:00 committed by Alessandro Ghedini
parent 7450a7f531
commit e940afec15

View File

@ -98,40 +98,40 @@ EOS
print $tmpl; print $tmpl;
sub parse_opts { sub parse_opts {
my ($cmd, $regex, $parsing_main_options) = @_; my ($cmd, $regex, $parsing_main_options) = @_;
my @list; my @list;
my @lines = split /\n/, `$cmd`; my @lines = split /\n/, `$cmd`;
foreach my $line (@lines) { foreach my $line (@lines) {
if ($line !~ /^$regex/) { if ($line !~ /^$regex/) {
next; next;
} }
my $entry = $1; my $entry = $1;
if ($parsing_main_options) { if ($parsing_main_options) {
$entry .= '=-'; $entry .= '=-';
} }
if (defined $2) { if (defined $2) {
my $desc = $2; my $desc = $2;
$desc =~ s/\:/\\:/g; $desc =~ s/\:/\\:/g;
$entry .= ':' . $desc; $entry .= ':' . $desc;
} }
if ($parsing_main_options) { if ($parsing_main_options) {
$entry .= ':'; $entry .= ':';
$entry .= '->ao' if ($1 eq '--ao'); $entry .= '->ao' if ($1 eq '--ao');
$entry .= '->vo' if ($1 eq '--vo'); $entry .= '->vo' if ($1 eq '--vo');
$entry .= '->af' if ($1 eq '--af'); $entry .= '->af' if ($1 eq '--af');
$entry .= '->vf' if ($1 eq '--vf'); $entry .= '->vf' if ($1 eq '--vf');
} }
push @list, $entry push @list, $entry
} }
return @list; return @list;
} }