Ignore:
Timestamp:
02/22/19 02:06:49 (5 years ago)
Author:
nanardon
Message:

Add '!' command, merge la-sql-log in la-cli

'!' command run a shell or execute command line by shell

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts/bin/la-sql-log

    r1311 r2218  
    66use Getopt::Long; 
    77use Pod::Usage; 
     8use LATMOS::Accounts::Cli::Context; 
     9use LATMOS::Accounts::Cli; 
    810 
    911=head1 NAME 
     
    1719=cut 
    1820 
     21Getopt::Long::Configure("pass_through"); 
    1922GetOptions( 
    2023    'c|config=s' => \my $config, 
    2124    'b|base=s'   => \my $base, 
    22     'o|object=s' => \my $otype, 
    2325    'help'       => sub { pod2usage(0) }, 
    2426) or pod2usage(); 
    25  
    26 $otype ||= 'user'; 
    2727 
    2828=head1 OPTIONS 
     
    5151$labase->wexported(1); 
    5252 
    53 my @logs = $ARGV[0]  
    54     ? $labase->getobjectlogs($otype, $ARGV[0]) 
    55     : $labase->getlogs(); 
     53my $Env = LATMOS::Accounts::Cli->new( 
     54    Context => LATMOS::Accounts::Cli::Context->new( 
     55        base => $labase, 
     56    ), 
     57); 
    5658 
    57 foreach(@logs) { 
    58     printf("%s (%d), %s: %s/%s (%d) %s\n", 
    59         $_->{logdate}, 
    60         $_->{irev} || -1, 
    61         $_->{username}, 
    62         $_->{otype}, 
    63         $_->{name}, 
    64         $_->{ikey}, 
    65         $_->{message}, 
    66     ); 
     59if (@ARGV) { 
     60    $Env->run('log', @ARGV); 
     61} else { 
     62    $Env->run('log'); 
    6763} 
     64 
Note: See TracChangeset for help on using the changeset viewer.