source: trunk/LATMOS-Accounts/bin/la-cli @ 1634

Last change on this file since 1634 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
RevLine 
[842]1#!/usr/bin/perl
2
3use strict;
4use warnings;
5use LATMOS::Accounts;
6use Getopt::Long;
7use Pod::Usage;
[844]8use 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
20GetOptions(
[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]34Use this configuration directory instead of the default one.
[842]35
36=item -b|--base basename
37
38Query this specific base instead of the default one.
39
[849]40=item --unexp
[842]41
42Take into account all objects (even non propagated ones, with attribute 'exported'=0)
43
[849]44=item --no-unexp
[842]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);
[1044]53my $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]58my $globalenv = LATMOS::Accounts::Cli::globalenv($labase);
[842]59
[844]60if (@ARGV) {
61    $globalenv->run(@ARGV);
62} else {
63    $globalenv->cli;
[842]64}
65print "\n";
66
67exit 0;
68
Note: See TracBrowser for help on using the repository browser.