diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2017-03-13 08:31:02 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2017-03-13 08:31:02 +0200 |
commit | 1c146d2aab40a87b241592eb894e0177a188eec9 (patch) | |
tree | 84b396c7d42fb6805c77d7e96444da6fdaf673c9 /lib/App/Beam.pm | |
parent | a80525354251593ba4b6830a5da32b0b04b1d518 (diff) | |
download | beam-1c146d2aab40a87b241592eb894e0177a188eec9.tar.gz beam-1c146d2aab40a87b241592eb894e0177a188eec9.tar.bz2 |
Implement the 'lint' subcommand.
Diffstat (limited to 'lib/App/Beam.pm')
-rw-r--r-- | lib/App/Beam.pm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/App/Beam.pm b/lib/App/Beam.pm index 1eeb625..d4b9242 100644 --- a/lib/App/Beam.pm +++ b/lib/App/Beam.pm @@ -15,6 +15,18 @@ use App::Beam::History::Entry qw(:state); my $default_config_file = '/etc/beam.conf'; +sub ck_dir { + my ($v) = @_; + + if (-d $$v) { + return undef; + } elsif (! -e $$v) { + return "directory does not exist"; + } else { + return "not a directory"; + } +} + sub ck_bool { my ($vref) = @_; my %bool = ( '1' => 1, @@ -94,7 +106,8 @@ my %parameters = ( section => { statfile => { default => '/var/spool/beam/beam.state' }, tempdir => { default => '/tmp' }, - archivedir => { default => '/var/backups' }, + archivedir => { default => '/var/backups', + check => \&ck_dir }, items => 1 } }, |