@@ -329,7 +329,26 @@ fn execute_commands(context: &mut ConsoleContext, mut input: &str, must_log_comm
329329fn entry_repl ( driver : Arc < TypeDBDriver > , runtime : BackgroundRuntime ) -> Repl < ConsoleContext > {
330330 let server_commands = Subcommand :: new ( "server" )
331331 . add ( CommandLeaf :: new ( "version" , "Retrieve server version." , server_version) ) ;
332-
332+
333+ let replica_commands = Subcommand :: new ( "replica" )
334+ . add ( CommandLeaf :: new ( "list" , "List replicas." , replica_list) )
335+ . add ( CommandLeaf :: new ( "primary" , "Get current primary replica." , replica_primary) )
336+ . add ( CommandLeaf :: new_with_inputs (
337+ "register" ,
338+ "Register new replica. Requires a clustering address, not a connection address." ,
339+ vec ! [
340+ CommandInput :: new( "replica id" , get_word, None , None ) ,
341+ CommandInput :: new( "clustering address" , get_word, None , None ) ,
342+ ] ,
343+ replica_register,
344+ ) )
345+ . add ( CommandLeaf :: new_with_input (
346+ "deregister" ,
347+ "Deregister existing replica." ,
348+ CommandInput :: new ( "replica id" , get_word, None , None ) ,
349+ replica_deregister,
350+ ) ) ;
351+
333352 let database_commands = Subcommand :: new ( "database" )
334353 . add ( CommandLeaf :: new ( "list" , "List databases on the server." , database_list) )
335354 . add ( CommandLeaf :: new_with_input (
@@ -414,25 +433,6 @@ fn entry_repl(driver: Arc<TypeDBDriver>, runtime: BackgroundRuntime) -> Repl<Con
414433 user_update_password,
415434 ) ) ;
416435
417- let replica_commands = Subcommand :: new ( "replica" )
418- . add ( CommandLeaf :: new ( "list" , "List replicas." , replica_list) )
419- . add ( CommandLeaf :: new ( "primary" , "Get current primary replica." , replica_primary) )
420- . add ( CommandLeaf :: new_with_inputs (
421- "register" ,
422- "Register new replica." ,
423- vec ! [
424- CommandInput :: new( "replica id" , get_word, None , None ) ,
425- CommandInput :: new( "address" , get_word, None , None ) ,
426- ] ,
427- replica_register,
428- ) )
429- . add ( CommandLeaf :: new_with_input (
430- "deregister" ,
431- "Deregister existing replica." ,
432- CommandInput :: new ( "replica id" , get_word, None , None ) ,
433- replica_deregister,
434- ) ) ;
435-
436436 let transaction_commands = Subcommand :: new ( "transaction" )
437437 . add ( CommandLeaf :: new_with_input (
438438 "read" ,
@@ -537,7 +537,6 @@ fn parse_addresses(args: &Args) -> AddressInfo {
537537 AddressInfo { only_https : is_https_address ( address) , addresses : Addresses :: try_from_address_str ( address) . unwrap ( ) }
538538 } else if let Some ( addresses) = & args. addresses {
539539 let split = addresses. split ( ',' ) . map ( str:: to_string) . collect :: < Vec < _ > > ( ) ;
540- println ! ( "Split: {split:?}" ) ;
541540 let only_https = split. iter ( ) . all ( |address| is_https_address ( address) ) ;
542541 AddressInfo { only_https, addresses : Addresses :: try_from_addresses_str ( split) . unwrap ( ) }
543542 } else if let Some ( translation) = & args. address_translation {
@@ -550,7 +549,7 @@ fn parse_addresses(args: &Args) -> AddressInfo {
550549 only_https = only_https && is_https_address ( public_address) ;
551550 map. insert ( public_address. to_string ( ) , private_address. to_string ( ) ) ;
552551 }
553- println ! ( "Translation map:: {map:?}" ) ;
552+ println ! ( "Translation map:: {map:?}" ) ; // TODO: Remove
554553 AddressInfo { only_https, addresses : Addresses :: try_from_translation_str ( map) . unwrap ( ) }
555554 } else {
556555 panic ! ( "At least one of --address, --addresses, or --address-translation must be provided." ) ;
0 commit comments