CLI: make -cfgNum work with "save" command (#2103)

This commit is contained in:
Maxime Besson 2020-02-24 11:57:56 +01:00
parent 53d7923cd4
commit 2c11111547
2 changed files with 2 additions and 1 deletions

View File

@ -82,6 +82,7 @@ Update local configuration cache
Save configuration
$ lemonldap-ng-cli save >conf.json
$ lemonldap-ng-cli -cfgNum 19 save >conf-19.json
Restore configuration

View File

@ -200,7 +200,7 @@ sub lastCfg {
sub save {
my ($self) = @_;
my $conf = $self->jsonResponse( '/confs/latest', 'full=1' );
my $conf = $self->jsonResponse( '/confs/' . $self->cfgNum, 'full=1' );
my $json = JSON->new->indent->canonical;
print $json->encode($conf);
}