From 7bae47fccb9a4d3990ee935f977324cde5fd7395 Mon Sep 17 00:00:00 2001 From: Ilia Shakhov Date: Fri, 11 Oct 2024 14:04:57 +0300 Subject: [PATCH] Enhance description for S3 export/import CLI parameters (#10331) --- .../lib/ydb_cli/commands/ydb_service_export.cpp | 14 ++++++++++++-- .../lib/ydb_cli/commands/ydb_service_import.cpp | 14 ++++++++++++-- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp index c18300861576..6431167d9674 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_export.cpp @@ -211,7 +211,12 @@ void TCommandExportToS3::Config(TConfig& config) { config.Opts->AddLongOption("s3-endpoint", "S3 endpoint to connect to") .Required().RequiredArgument("ENDPOINT").StoreResult(&AwsEndpoint); - config.Opts->AddLongOption("scheme", "S3 endpoint scheme") + auto colors = NColorizer::AutoColors(Cout); + config.Opts->AddLongOption("scheme", TStringBuilder() + << "S3 endpoint scheme - " + << colors.BoldColor() << "http" << colors.OldColor() + << " or " + << colors.BoldColor() << "https" << colors.OldColor()) .RequiredArgument("SCHEME").StoreResult(&AwsScheme).DefaultValue(AwsScheme); TStringBuilder storageClassHelp; @@ -277,7 +282,12 @@ void TCommandExportToS3::Config(TConfig& config) { << " - zstd-N (N is compression level, e.g. zstd-3)" << Endl) .RequiredArgument("STRING").StoreResult(&Compression); - config.Opts->AddLongOption("use-virtual-addressing", "S3 bucket virtual addressing") + config.Opts->AddLongOption("use-virtual-addressing", TStringBuilder() + << "Sets bucket URL style. Value " + << colors.BoldColor() << "true" << colors.OldColor() + << " means use Virtual-Hosted-Style URL, " + << colors.BoldColor() << "false" << colors.OldColor() + << " - Path-Style URL.") .RequiredArgument("BOOL").StoreResult(&UseVirtualAddressing).DefaultValue("true"); AddDeprecatedJsonOption(config); diff --git a/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp b/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp index 94847ed3a6c9..8ab5de692959 100644 --- a/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp +++ b/ydb/public/lib/ydb_cli/commands/ydb_service_import.cpp @@ -47,7 +47,12 @@ void TCommandImportFromS3::Config(TConfig& config) { config.Opts->AddLongOption("s3-endpoint", "S3 endpoint to connect to") .Required().RequiredArgument("ENDPOINT").StoreResult(&AwsEndpoint); - config.Opts->AddLongOption("scheme", "S3 endpoint scheme") + auto colors = NColorizer::AutoColors(Cout); + config.Opts->AddLongOption("scheme", TStringBuilder() + << "S3 endpoint scheme - " + << colors.BoldColor() << "http" << colors.OldColor() + << " or " + << colors.BoldColor() << "https" << colors.OldColor()) .RequiredArgument("SCHEME").StoreResult(&AwsScheme).DefaultValue(AwsScheme); config.Opts->AddLongOption("bucket", "S3 bucket") @@ -92,7 +97,12 @@ void TCommandImportFromS3::Config(TConfig& config) { config.Opts->AddLongOption("retries", "Number of retries") .RequiredArgument("NUM").StoreResult(&NumberOfRetries).DefaultValue(NumberOfRetries); - config.Opts->AddLongOption("use-virtual-addressing", "S3 bucket virtual addressing") + config.Opts->AddLongOption("use-virtual-addressing", TStringBuilder() + << "Sets bucket URL style. Value " + << colors.BoldColor() << "true" << colors.OldColor() + << " means use Virtual-Hosted-Style URL, " + << colors.BoldColor() << "false" << colors.OldColor() + << " - Path-Style URL.") .RequiredArgument("BOOL").StoreResult(&UseVirtualAddressing).DefaultValue("true"); config.Opts->AddLongOption("no-acl", "Prevent importing of ACL and owner")