diff options
author | Norbert Preining <preining@logic.at> | 2009-08-26 12:00:55 +0000 |
---|---|---|
committer | Norbert Preining <preining@logic.at> | 2009-08-26 12:00:55 +0000 |
commit | c4b5e712816bb19900ad280d0fa16fc99fbb9103 (patch) | |
tree | 4218ad423e0a090068f19afc767cc6a92f085977 | |
parent | 3a7b4e71fab6a3e7a48dfdd71b8bdf9d464e5201 (diff) |
make the check for not-supported options generic so that adding
a new variant (as done with location|repository) does not break
automatically without adding a special case.
git-svn-id: svn://tug.org/texlive/trunk@14866 c570f23f-e606-0410-a88d-b1316a301751
-rwxr-xr-x | Master/texmf/scripts/texlive/tlmgr.pl | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl index 26a36b8a1a3..5fef883efde 100755 --- a/Master/texmf/scripts/texlive/tlmgr.pl +++ b/Master/texmf/scripts/texlive/tlmgr.pl @@ -266,16 +266,17 @@ sub main { if defined($actionoptions{$action}); my @notvalidargs; for my $k (keys %opts) { - my $kk = $k; - if ($k eq "n" || $k eq "dry-run") { - $kk = "dry-run|n"; - } - if ($k eq "location" || $k eq "repository" || $k eq "repo") { - $kk = "location|repository|repo"; - } - if (!defined($suppargs{$kk}) && !defined($globaloptions{$kk})) { - push @notvalidargs, $k; + my @allargs = keys %suppargs; + push @allargs, keys %globaloptions; + my $found = 0; + for my $ok (@allargs) { + my @variants = split '\|', $ok; + if (TeXLive::TLUtils::member($k, @variants)) { + $found = 1; + last; + } } + push @notvalidargs, $k if !$found; } if (@notvalidargs) { my $msg = |