Last change
on this file since 2261 was
2218,
checked in by nanardon, 5 years ago
|
Add '!' command, merge la-sql-log in la-cli
'!' command run a shell or execute command line by shell
|
-
Property svn:executable set to
*
|
File size:
1.1 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::Context; |
---|
9 | use LATMOS::Accounts::Cli; |
---|
10 | |
---|
11 | =head1 NAME |
---|
12 | |
---|
13 | la-sql-log - Dislay objects log |
---|
14 | |
---|
15 | =head1 SYNOPSIS |
---|
16 | |
---|
17 | la-edit [options] [obj_id] |
---|
18 | |
---|
19 | =cut |
---|
20 | |
---|
21 | Getopt::Long::Configure("pass_through"); |
---|
22 | GetOptions( |
---|
23 | 'c|config=s' => \my $config, |
---|
24 | 'b|base=s' => \my $base, |
---|
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 -o|object object_type |
---|
41 | |
---|
42 | Query will be performed on this object. Default is the 'User' object. |
---|
43 | |
---|
44 | =back |
---|
45 | |
---|
46 | =cut |
---|
47 | |
---|
48 | my $LA = LATMOS::Accounts->new($config, noacl => 1); |
---|
49 | my $labase = $LA->base($base); |
---|
50 | $labase && $labase->load or die "Cannot load base"; |
---|
51 | $labase->wexported(1); |
---|
52 | |
---|
53 | my $Env = LATMOS::Accounts::Cli->new( |
---|
54 | Context => LATMOS::Accounts::Cli::Context->new( |
---|
55 | base => $labase, |
---|
56 | ), |
---|
57 | ); |
---|
58 | |
---|
59 | if (@ARGV) { |
---|
60 | $Env->run('log', @ARGV); |
---|
61 | } else { |
---|
62 | $Env->run('log'); |
---|
63 | } |
---|
64 | |
---|
Note: See
TracBrowser
for help on using the repository browser.