@@ -332,7 +332,26 @@ fn execute_commands(
332
332
fn entry_repl ( driver : Arc < TypeDBDriver > , runtime : BackgroundRuntime ) -> Repl < ConsoleContext > {
333
333
let server_commands = Subcommand :: new ( "server" )
334
334
. 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
+
336
355
let database_commands = Subcommand :: new ( "database" )
337
356
. add ( CommandLeaf :: new ( "list" , "List databases on the server." , database_list) )
338
357
. add ( CommandLeaf :: new_with_input (
@@ -406,25 +425,6 @@ fn entry_repl(driver: Arc<TypeDBDriver>, runtime: BackgroundRuntime) -> Repl<Con
406
425
user_update_password,
407
426
) ) ;
408
427
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
-
428
428
let transaction_commands = Subcommand :: new ( "transaction" )
429
429
. add ( CommandLeaf :: new_with_input (
430
430
"read" ,
@@ -514,7 +514,6 @@ fn parse_addresses(args: &Args) -> AddressInfo {
514
514
AddressInfo { only_https : is_https_address ( address) , addresses : Addresses :: try_from_address_str ( address) . unwrap ( ) }
515
515
} else if let Some ( addresses) = & args. addresses {
516
516
let split = addresses. split ( ',' ) . map ( str:: to_string) . collect :: < Vec < _ > > ( ) ;
517
- println ! ( "Split: {split:?}" ) ;
518
517
let only_https = split. iter ( ) . all ( |address| is_https_address ( address) ) ;
519
518
AddressInfo { only_https, addresses : Addresses :: try_from_addresses_str ( split) . unwrap ( ) }
520
519
} else if let Some ( translation) = & args. address_translation {
@@ -527,7 +526,7 @@ fn parse_addresses(args: &Args) -> AddressInfo {
527
526
only_https = only_https && is_https_address ( public_address) ;
528
527
map. insert ( public_address. to_string ( ) , private_address. to_string ( ) ) ;
529
528
}
530
- println ! ( "Translation map:: {map:?}" ) ;
529
+ println ! ( "Translation map:: {map:?}" ) ; // TODO: Remove
531
530
AddressInfo { only_https, addresses : Addresses :: try_from_translation_str ( map) . unwrap ( ) }
532
531
} else {
533
532
panic ! ( "At least one of --address, --addresses, or --address-translation must be provided." ) ;
0 commit comments