Last change
on this file since 1707 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
|
Rev | Line | |
---|
[842] | 1 | #!/usr/bin/perl |
---|
| 2 | |
---|
| 3 | use strict; |
---|
| 4 | use warnings; |
---|
| 5 | use LATMOS::Accounts; |
---|
| 6 | use Getopt::Long; |
---|
| 7 | use Pod::Usage; |
---|
[844] | 8 | use LATMOS::Accounts::Cli; |
---|
[842] | 9 | |
---|
| 10 | =head1 NAME |
---|
| 11 | |
---|
[849] | 12 | la-cli - A powerfull commandline tool to manage LATMOS::Accounts contents |
---|
[842] | 13 | |
---|
| 14 | =head1 SYNOPSIS |
---|
| 15 | |
---|
[849] | 16 | la-cli [options] |
---|
[842] | 17 | |
---|
| 18 | =cut |
---|
| 19 | |
---|
| 20 | GetOptions( |
---|
[849] | 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) }, |
---|
[842] | 26 | ) or pod2usage(); |
---|
| 27 | |
---|
| 28 | =head1 OPTIONS |
---|
| 29 | |
---|
| 30 | =over 4 |
---|
| 31 | |
---|
[861] | 32 | =item -c|--config configdir |
---|
[842] | 33 | |
---|
[861] | 34 | Use this configuration directory instead of the default one. |
---|
[842] | 35 | |
---|
| 36 | =item -b|--base basename |
---|
| 37 | |
---|
| 38 | Query this specific base instead of the default one. |
---|
| 39 | |
---|
[849] | 40 | =item --unexp |
---|
[842] | 41 | |
---|
| 42 | Take into account all objects (even non propagated ones, with attribute 'exported'=0) |
---|
| 43 | |
---|
[849] | 44 | =item --no-unexp |
---|
[842] | 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); |
---|
[1044] | 53 | my $labase = $LA->base($base); |
---|
[842] | 54 | $labase && $labase->load or die "Cannot load base"; |
---|
| 55 | |
---|
[849] | 56 | $labase->unexported($nounexp ? 0 : 1); |
---|
[842] | 57 | |
---|
[844] | 58 | my $globalenv = LATMOS::Accounts::Cli::globalenv($labase); |
---|
[842] | 59 | |
---|
[844] | 60 | if (@ARGV) { |
---|
| 61 | $globalenv->run(@ARGV); |
---|
| 62 | } else { |
---|
| 63 | $globalenv->cli; |
---|
[842] | 64 | } |
---|
| 65 | print "\n"; |
---|
| 66 | |
---|
| 67 | exit 0; |
---|
| 68 | |
---|
Note: See
TracBrowser
for help on using the repository browser.