summaryrefslogtreecommitdiff
path: root/Master
diff options
context:
space:
mode:
Diffstat (limited to 'Master')
-rwxr-xr-xMaster/texmf/scripts/texlive/tlmgr.pl62
1 files changed, 31 insertions, 31 deletions
diff --git a/Master/texmf/scripts/texlive/tlmgr.pl b/Master/texmf/scripts/texlive/tlmgr.pl
index 4d4a9e522c4..193fe69f132 100755
--- a/Master/texmf/scripts/texlive/tlmgr.pl
+++ b/Master/texmf/scripts/texlive/tlmgr.pl
@@ -120,8 +120,8 @@ if ($action =~ m/^generate$/i) {
merge_into(\%ret, action_generate());
} elsif ($action =~ m/^arch$/i) {
merge_into(\%ret, action_arch());
-} elsif ($action =~ m/^default$/i) {
- merge_into(\%ret, action_default());
+} elsif ($action =~ m/^option$/i) {
+ merge_into(\%ret, action_option());
# should we do postinstall stuff?
exit(0);
} elsif ($action =~ m/^list$/i) {
@@ -132,8 +132,8 @@ if ($action =~ m/^generate$/i) {
merge_into(\%ret, action_install());
} elsif ($action =~ m/^update$/i) {
merge_into(\%ret, action_update());
-} elsif ($action =~ m/^(global)?search$/i) {
- merge_into(\%ret, action_search($action));
+} elsif ($action =~ m/^search$/i) {
+ merge_into(\%ret, action_search());
exit(0);
} elsif ($action =~ m/^show$/i) {
merge_into(\%ret, action_show());
@@ -408,24 +408,23 @@ sub action_show {
}
sub action_search {
- my ($action) = shift;
+ my $opt_global = 0;
+ my $opt_file = 0;
+ Getopt::Long::Configure(qw(no_pass_through));
+ GetOptions("global" => \$opt_global,
+ "file" => \$opt_file) or pod2usage(1);
my $r = shift @ARGV;
my $ret = "";
my $tlpdb;
- my $searchfile = 0;
init_local_db();
- if ($r =~ m/^-file$/i) {
- $searchfile = 1;
- $r = shift @ARGV;
- }
- if ($action =~ m/^globalsearch$/i) {
+ if ($opt_global) {
my $tlmediasrc = TeXLive::TLMedia->new($location);
$tlpdb = $tlmediasrc->tlpdb;
} else {
$tlpdb = $localtlpdb;
}
foreach my $pkg ($tlpdb->list_packages) {
- if ($searchfile) {
+ if ($opt_file) {
my @ret = grep(m;$r;, $tlpdb->get_package($pkg)->all_files);
if (@ret) {
print "$pkg:\n";
@@ -537,9 +536,9 @@ sub action_list {
return;
}
-sub action_default {
+sub action_option {
my $what = shift @ARGV;
- die("default needs at least one argument") unless defined($what);
+ $what = "show" unless defined($what);
init_local_db();
if ($what =~ m/^location$/i) {
# changes the default location
@@ -986,7 +985,7 @@ written to the terminal.
=back
-=item B<default show>
+=item B<default [show]>
=item B<default I<key> [I<value>]>
@@ -1024,32 +1023,33 @@ Options:
=item B<--dry-run>
-For installation and removal of packages, this options enables the chicken
-mode, i.e., nothing is actually installed but the actions to be performed
-are written to the terminal.
-
-Note that for all other type of options but package installation and removal
-this options does I<NOT> work!
+Nothing is actually installed; instead, the actions to be performed are
+written to the terminal.
=back
-=item B<search [--file] what>
+=item B<search [OPTIONS] what>
-Search the names, short and long descriptions of all locally installed packages
-for the given argument (interpreted as regexp).
+By default searches the names, short and long descriptions of all locally
+installed packages for the given argument (interpreted as regexp).
-With the B<--file> argument searches for files containing C<what> somewhere
-in the path, and returning each package with the respective hit.
-=item B<globalsearch [--file] what>
+Options:
-Search the names, short and long descriptions of all packages available on
-the install media.
+=over 16
+
+=item B<--filename>
+
+Searches filenames containing B<what> and returns for each package all files
+containing B<what>.
-With the B<--file> argument searches for files containing C<what> somewhere
-in the path, and returning each package with the respective hit.
+=item B<--global>
+Search the TeX Live Database of the installation medium and not the local
+installation.
+
+=back
=item B<show I<pkg>...>