Improve cli logs (#1750)
This commit is contained in:
parent
1f1eeab9c8
commit
cf297736b5
@ -31,6 +31,8 @@ has yes => ( is => 'rw', isa => 'Bool', default => 0 );
|
|||||||
|
|
||||||
has force => ( is => 'rw', isa => 'Bool', default => 0 );
|
has force => ( is => 'rw', isa => 'Bool', default => 0 );
|
||||||
|
|
||||||
|
has log => ( is => 'rw' );
|
||||||
|
|
||||||
sub get {
|
sub get {
|
||||||
my ( $self, @keys ) = @_;
|
my ( $self, @keys ) = @_;
|
||||||
die 'get requires at least one key' unless (@keys);
|
die 'get requires at least one key' unless (@keys);
|
||||||
@ -250,10 +252,10 @@ sub _save {
|
|||||||
}
|
}
|
||||||
$new->{cfgAuthor} = 'lmConfigEditor: ' . `whoami`;
|
$new->{cfgAuthor} = 'lmConfigEditor: ' . `whoami`;
|
||||||
chomp $new->{cfgAuthor};
|
chomp $new->{cfgAuthor};
|
||||||
$new->{cfgAuthorIP} = '';
|
$new->{cfgAuthorIP} = '127.0.0.1';
|
||||||
$new->{cfgDate} = time;
|
$new->{cfgDate} = time;
|
||||||
$new->{cfgVersion} = $VERSION;
|
$new->{cfgVersion} = $Lemonldap::NG::Manager::VERSION;
|
||||||
$new->{cfgLog} = '';
|
$new->{cfgLog} = $self->log || '';
|
||||||
$new->{key} ||= join( '',
|
$new->{key} ||= join( '',
|
||||||
map { chr( int( ord( Crypt::URandom::urandom(1) ) * 94 / 256 ) + 33 ) }
|
map { chr( int( ord( Crypt::URandom::urandom(1) ) * 94 / 256 ) + 33 ) }
|
||||||
( 1 .. 16 ) );
|
( 1 .. 16 ) );
|
||||||
@ -395,6 +397,10 @@ Set it to 1 to save a configuration earlier than latest
|
|||||||
|
|
||||||
Confirmation array line format. Default to "%-25s | %-25s | %-25s"
|
Confirmation array line format. Default to "%-25s | %-25s | %-25s"
|
||||||
|
|
||||||
|
=head3 log()
|
||||||
|
|
||||||
|
String to insert in configuration log field (cfgLog)
|
||||||
|
|
||||||
=head2 run()
|
=head2 run()
|
||||||
|
|
||||||
The main method: it reads option, command and launch the corresponding
|
The main method: it reads option, command and launch the corresponding
|
||||||
|
Loading…
Reference in New Issue
Block a user