aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2017-03-07 16:57:12 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2017-03-07 16:57:12 +0200
commit25cc6f28c808169f1b91b319b68a1f2757532f25 (patch)
treefefb6b9ed29638a29bb74d0c324292da5fcfa222
parent068dcd502cc83d60c90443127352ec255df442db (diff)
downloadbeam-25cc6f28c808169f1b91b319b68a1f2757532f25.tar.gz
beam-25cc6f28c808169f1b91b319b68a1f2757532f25.tar.bz2
Initial implementation of the list subcommand
* MANIFEST: Update * lib/App/Beam/List.pm: New file. * beam (list): New subcommand * lib/App/Beam.pm: End with 1; * lib/App/Beam/Command.pm: Likewise. * lib/App/Beam/Config.pm: Likewise. * lib/App/Beam/Config/Locus.pm: Likewise.
-rw-r--r--MANIFEST1
-rwxr-xr-xbeam6
-rw-r--r--lib/App/Beam.pm1
-rw-r--r--lib/App/Beam/Command.pm6
-rw-r--r--lib/App/Beam/Config.pm1
-rw-r--r--lib/App/Beam/Config/Locus.pm1
-rw-r--r--lib/App/Beam/List.pm25
7 files changed, 34 insertions, 7 deletions
diff --git a/MANIFEST b/MANIFEST
index 95b3a54..48daf32 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -9,6 +9,7 @@ lib/App/Beam.pm
lib/App/Beam/Backend.pm
lib/App/Beam/Backend/Tar.pm
lib/App/Beam/Command.pm
+lib/App/Beam/List.pm
t/TestConfig.pm
t/conf01.t
t/conf02.t
diff --git a/beam b/beam
index 48a9ebd..8944668 100755
--- a/beam
+++ b/beam
@@ -1,7 +1,6 @@
#!/usr/bin/perl
use strict;
-use App::Beam::Backup;
use Pod::Usage;
use Pod::Man;
use File::Basename;
@@ -35,7 +34,12 @@ unless (@ARGV) {
my %ctab = (
backup => sub {
+ use App::Beam::Backup;
return new App::Beam::Backup(@_);
+ },
+ list => sub {
+ use App::Beam::List;
+ return new App::Beam::List(@_);
}
);
diff --git a/lib/App/Beam.pm b/lib/App/Beam.pm
index 54b3cd3..6a654ca 100644
--- a/lib/App/Beam.pm
+++ b/lib/App/Beam.pm
@@ -462,3 +462,4 @@ sub run {
$self->abend(EX_SOFTWARE, "unsupported command $_[0]");
}
+1;
diff --git a/lib/App/Beam/Command.pm b/lib/App/Beam/Command.pm
index ed6c686..1b6c343 100644
--- a/lib/App/Beam/Command.pm
+++ b/lib/App/Beam/Command.pm
@@ -88,9 +88,3 @@ sub exit_code {
}
1;
-
-
-
-
-
-
diff --git a/lib/App/Beam/Config.pm b/lib/App/Beam/Config.pm
index 5e5e7d7..d76cd1f 100644
--- a/lib/App/Beam/Config.pm
+++ b/lib/App/Beam/Config.pm
@@ -1088,3 +1088,4 @@ sub lint {
return $self->{error_count} == 0;
}
+1;
diff --git a/lib/App/Beam/Config/Locus.pm b/lib/App/Beam/Config/Locus.pm
index 7d1087c..3e60791 100644
--- a/lib/App/Beam/Config/Locus.pm
+++ b/lib/App/Beam/Config/Locus.pm
@@ -204,3 +204,4 @@ sub fixup_lines {
delete $self->{string};
}
+1;
diff --git a/lib/App/Beam/List.pm b/lib/App/Beam/List.pm
new file mode 100644
index 0000000..3bba7e0
--- /dev/null
+++ b/lib/App/Beam/List.pm
@@ -0,0 +1,25 @@
+package App::Beam::List;
+
+use strict;
+use Carp;
+use POSIX qw(strftime);
+
+require App::Beam;
+our @ISA = qw(App::Beam);
+
+sub run {
+ my $self = shift;
+
+ $self->lock();
+ my @stat = @{$self->{status}};
+ shift @stat;
+ foreach my $ent (@stat) {
+ print strftime "%c ", localtime $ent->{timestamp};
+ printf("% 3d% 3d% 3d %s", $ent->{cycle}, $ent->{round}, $ent->{level},
+ $ent->{result});
+ print "\n";
+ }
+ $self->unlock();
+}
+
+1;

Return to:

Send suggestions and report system problems to the System administrator.