1package App::SD::CLI::Command::Clone; 2use Any::Moose; 3extends 'Prophet::CLI::Command::Clone'; 4with 'App::SD::CLI::NewReplicaCommand'; 5 6sub ARG_TRANSLATIONS { 7 shift->SUPER::ARG_TRANSLATIONS(), 8 # this arg is used in the new_replica_wizard sub 9 n => 'non-interactive', 10}; 11 12sub usage_msg { 13 my $self = shift; 14 my $cmd = $self->cli->get_script_name; 15 16 return <<"END_USAGE"; 17usage: ${cmd}clone --from <url> [--as <alias>] [--non-interactive] | --local 18 19Options: 20 -n | --non-interactive - Don't prompt to specify email address for new 21 database 22 --as - Save an alias for this source, which can later be 23 used instead of the URL. 24 --local - Probe the local network for mDNS-advertised 25 replicas and list them. 26END_USAGE 27} 28 29override run => sub { 30 my $self = shift; 31 32 # clone dies if the target replica already exists, so no need 33 # to worry about not running the wizard if the clone doesn't run 34 $self->SUPER::run(); 35 36 Prophet::CLI->end_pager(); 37 38 # Prompt for SD setup (specifically email address for changes) after the 39 # clone, but *don't* immediately edit the database's settings, since a 40 # cloned database should have already been setup previously. 41 $self->new_replica_wizard( edit_settings => 0 ); 42}; 43 44__PACKAGE__->meta->make_immutable; 45no Any::Moose; 46 471; 48 49