| 1 | package App::SD::CLI::Command::Init; | ||
| 2 | use Any::Moose; | ||
| 3 | extends 'Prophet::CLI::Command::Init'; | ||
| 4 | with 'App::SD::CLI::NewReplicaCommand'; | ||
| 5 | |||
| 6 | sub usage_msg { | ||
| 7 | my $self = shift; | ||
| 8 | my $cmd = $self->cli->get_script_name; | ||
| 9 | |||
| 10 | return <<"END_USAGE"; | ||
| 11 | usage: ${cmd}init [--non-interactive] | ||
| 12 | |||
| 13 | Options: | ||
| 14 | -n | --non-interactive - Don't prompt to edit settings or specify email | ||
| 15 | address for new database | ||
| 16 | END_USAGE | ||
| 17 | } | ||
| 18 | |||
| 19 | sub ARG_TRANSLATIONS { | ||
| 20 | shift->SUPER::ARG_TRANSLATIONS(), | ||
| 21 | n => 'non-interactive', | ||
| 22 | }; | ||
| 23 | |||
| 24 | override run => sub { | ||
| 25 | my $self = shift; | ||
| 26 | |||
| 27 | $self->SUPER::run(); | ||
| 28 | |||
| 29 | Prophet::CLI->end_pager(); | ||
| 30 | |||
| 31 | $self->new_replica_wizard(); | ||
| 32 | }; | ||
| 33 | |||
| 34 | __PACKAGE__->meta->make_immutable; | ||
| 35 | no Any::Moose; | ||
| 36 | |||
| 37 | 1; | ||
| 38 |