source: LATMOS-Accounts/bin/la-rev @ 837

Last change on this file since 837 was 837, checked in by nanardon, 14 years ago
  • add tools to get current base revision
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 734 bytes
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use LATMOS::Accounts;
6use Getopt::Long;
7use Pod::Usage;
8
9=head1 NAME
10
11    la-rev - Show current base revision
12
13=head1 SYNOPSIS
14
15    la-rev
16
17=cut
18
19GetOptions(
20    'c|config=s' => \my $config,
21    'b|base=s'   => \my $base,
22    'help'       => sub { pod2usage(0) },
23) or pod2usage();
24
25=head1 OPTIONS
26
27=over 4
28
29=item -c|--config configfile
30
31Use this configuration file instead of the default one.
32
33=item -b|--base basename
34
35Query this specific base instead of the default one.
36
37=cut
38
39my $LA = LATMOS::Accounts->new($config, noacl => 1);
40my $labase = $base ? $LA->base($base) : $LA->default_base;
41$labase && $labase->load or die "Cannot load base";
42
43print $labase->current_rev . "\n";
44
45exit(0);
Note: See TracBrowser for help on using the repository browser.