source: LATMOS-Accounts/bin/la-cli @ 849

Last change on this file since 849 was 849, checked in by nanardon, 14 years ago
  • make unxported mode options more explicit
  • fix POD according behavior
  • Property svn:executable set to *
  • Property svn:keywords set to Id
File size: 1.2 KB
Line 
1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use LATMOS::Accounts;
6use Getopt::Long;
7use Pod::Usage;
8use LATMOS::Accounts::Cli;
9
10=head1 NAME
11
12    la-cli - A powerfull commandline tool to manage LATMOS::Accounts contents
13
14=head1 SYNOPSIS
15
16    la-cli [options]
17
18=cut
19
20GetOptions(
21    'c|config=s'        => \my $config,
22    'b|base=s'          => \my $base,
23    'no-unexp|wo-unexp' => \my $nounexp,
24    'with-unexp'        => \my $unexp,
25    'help'              => sub { pod2usage(0) },
26) or pod2usage();
27
28=head1 OPTIONS
29
30=over 4
31
32=item -c|--config configfile
33
34Use this configuration file instead of the default one.
35
36=item -b|--base basename
37
38Query this specific base instead of the default one.
39
40=item --unexp
41
42Take into account all objects (even non propagated ones, with attribute 'exported'=0)
43
44=item --no-unexp
45
46Take into account only propagated objects (attribute 'exported'=1) (default)
47
48=back
49
50=cut
51
52my $LA = LATMOS::Accounts->new($config, noacl => 1);
53my $labase = $base ? $LA->base($base) : $LA->default_base;
54$labase && $labase->load or die "Cannot load base";
55
56$labase->unexported($nounexp ? 0 : 1);
57
58my $globalenv = LATMOS::Accounts::Cli::globalenv($labase);
59
60if (@ARGV) {
61    $globalenv->run(@ARGV);
62} else {
63    $globalenv->cli;
64}
65print "\n";
66
67exit 0;
68
Note: See TracBrowser for help on using the repository browser.