@@ -332,7 +332,26 @@ fn execute_commands(
332332fn entry_repl ( driver : Arc < TypeDBDriver > , runtime : BackgroundRuntime ) -> Repl < ConsoleContext > {
333333 let server_commands = Subcommand :: new ( "server" )
334334 . add ( CommandLeaf :: new ( "version" , "Retrieve server version." , server_version) ) ;
335-
335+
336+ let replica_commands = Subcommand :: new ( "replica" )
337+ . add ( CommandLeaf :: new ( "list" , "List replicas." , replica_list) )
338+ . add ( CommandLeaf :: new ( "primary" , "Get current primary replica." , replica_primary) )
339+ . add ( CommandLeaf :: new_with_inputs (
340+ "register" ,
341+ "Register new replica. Requires a clustering address, not a connection address." ,
342+ vec ! [
343+ CommandInput :: new( "replica id" , get_word, None , None ) ,
344+ CommandInput :: new( "clustering address" , get_word, None , None ) ,
345+ ] ,
346+ replica_register,
347+ ) )
348+ . add ( CommandLeaf :: new_with_input (
349+ "deregister" ,
350+ "Deregister existing replica." ,
351+ CommandInput :: new ( "replica id" , get_word, None , None ) ,
352+ replica_deregister,
353+ ) ) ;
354+
336355 let database_commands = Subcommand :: new ( "database" )
337356 . add ( CommandLeaf :: new ( "list" , "List databases on the server." , database_list) )
338357 . add ( CommandLeaf :: new_with_input (
@@ -406,25 +425,6 @@ fn entry_repl(driver: Arc<TypeDBDriver>, runtime: BackgroundRuntime) -> Repl<Con
406425 user_update_password,
407426 ) ) ;
408427
409- let replica_commands = Subcommand :: new ( "replica" )
410- . add ( CommandLeaf :: new ( "list" , "List replicas." , replica_list) )
411- . add ( CommandLeaf :: new ( "primary" , "Get current primary replica." , replica_primary) )
412- . add ( CommandLeaf :: new_with_inputs (
413- "register" ,
414- "Register new replica." ,
415- vec ! [
416- CommandInput :: new( "replica id" , get_word, None , None ) ,
417- CommandInput :: new( "address" , get_word, None , None ) ,
418- ] ,
419- replica_register,
420- ) )
421- . add ( CommandLeaf :: new_with_input (
422- "deregister" ,
423- "Deregister existing replica." ,
424- CommandInput :: new ( "replica id" , get_word, None , None ) ,
425- replica_deregister,
426- ) ) ;
427-
428428 let transaction_commands = Subcommand :: new ( "transaction" )
429429 . add ( CommandLeaf :: new_with_input (
430430 "read" ,
@@ -514,7 +514,6 @@ fn parse_addresses(args: &Args) -> AddressInfo {
514514 AddressInfo { only_https : is_https_address ( address) , addresses : Addresses :: try_from_address_str ( address) . unwrap ( ) }
515515 } else if let Some ( addresses) = & args. addresses {
516516 let split = addresses. split ( ',' ) . map ( str:: to_string) . collect :: < Vec < _ > > ( ) ;
517- println ! ( "Split: {split:?}" ) ;
518517 let only_https = split. iter ( ) . all ( |address| is_https_address ( address) ) ;
519518 AddressInfo { only_https, addresses : Addresses :: try_from_addresses_str ( split) . unwrap ( ) }
520519 } else if let Some ( translation) = & args. address_translation {
@@ -527,7 +526,7 @@ fn parse_addresses(args: &Args) -> AddressInfo {
527526 only_https = only_https && is_https_address ( public_address) ;
528527 map. insert ( public_address. to_string ( ) , private_address. to_string ( ) ) ;
529528 }
530- println ! ( "Translation map:: {map:?}" ) ;
529+ println ! ( "Translation map:: {map:?}" ) ; // TODO: Remove
531530 AddressInfo { only_https, addresses : Addresses :: try_from_translation_str ( map) . unwrap ( ) }
532531 } else {
533532 panic ! ( "At least one of --address, --addresses, or --address-translation must be provided." ) ;
0 commit comments