source: trunk/LATMOS-Accounts/bin/la-sql-log @ 2393

Last change on this file since 2393 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
3use strict;
4use warnings;
5use LATMOS::Accounts;
6use Getopt::Long;
7use Pod::Usage;
8use LATMOS::Accounts::Cli::Context;
9use 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
21Getopt::Long::Configure("pass_through");
22GetOptions(
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
34Use this configuration directory instead of the default one.
35
36=item -b|--base basename
37
38Query this specific base instead of the default one.
39
40=item -o|object object_type
41
42Query will be performed on this object. Default is the 'User' object.
43
44=back
45
46=cut
47
48my $LA = LATMOS::Accounts->new($config, noacl => 1);
49my $labase = $LA->base($base);
50$labase && $labase->load or die "Cannot load base";
51$labase->wexported(1);
52
53my $Env = LATMOS::Accounts::Cli->new(
54    Context => LATMOS::Accounts::Cli::Context->new(
55        base => $labase,
56    ),
57);
58
59if (@ARGV) {
60    $Env->run('log', @ARGV);
61} else {
62    $Env->run('log');
63}
64
Note: See TracBrowser for help on using the repository browser.