Last change
on this file since 2274 was
1044,
checked in by nanardon, 12 years ago
|
Kill redundant LATMOS::Account::default_base()
Use $LA->base(undef) to get default base instead
|
-
Property svn:executable set to
*
-
Property svn:keywords set to
Id
|
File size:
1.2 KB
|
Line | |
---|
1 | #!/usr/bin/perl |
---|
2 | |
---|
3 | use strict; |
---|
4 | use warnings; |
---|
5 | use LATMOS::Accounts; |
---|
6 | use Getopt::Long; |
---|
7 | use Pod::Usage; |
---|
8 | use 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 | |
---|
20 | GetOptions( |
---|
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 configdir |
---|
33 | |
---|
34 | Use this configuration directory instead of the default one. |
---|
35 | |
---|
36 | =item -b|--base basename |
---|
37 | |
---|
38 | Query this specific base instead of the default one. |
---|
39 | |
---|
40 | =item --unexp |
---|
41 | |
---|
42 | Take into account all objects (even non propagated ones, with attribute 'exported'=0) |
---|
43 | |
---|
44 | =item --no-unexp |
---|
45 | |
---|
46 | Take into account only propagated objects (attribute 'exported'=1) (default) |
---|
47 | |
---|
48 | =back |
---|
49 | |
---|
50 | =cut |
---|
51 | |
---|
52 | my $LA = LATMOS::Accounts->new($config, noacl => 1); |
---|
53 | my $labase = $LA->base($base); |
---|
54 | $labase && $labase->load or die "Cannot load base"; |
---|
55 | |
---|
56 | $labase->unexported($nounexp ? 0 : 1); |
---|
57 | |
---|
58 | my $globalenv = LATMOS::Accounts::Cli::globalenv($labase); |
---|
59 | |
---|
60 | if (@ARGV) { |
---|
61 | $globalenv->run(@ARGV); |
---|
62 | } else { |
---|
63 | $globalenv->cli; |
---|
64 | } |
---|
65 | print "\n"; |
---|
66 | |
---|
67 | exit 0; |
---|
68 | |
---|
Note: See
TracBrowser
for help on using the repository browser.