Single source ledger-tool encoding arg (#28622)

The argument is nearly identical for both instances that use it, so
de-duplicate the repeated config.
This commit is contained in:
steviez 2022-10-27 09:35:27 +02:00 committed by GitHub
parent fa65b50b9a
commit 54fc768fcc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 16 deletions

View File

@ -1486,6 +1486,13 @@ fn main() {
.multiple(true)
.help("Specify the configuration file for the Geyser plugin.");
let accounts_data_encoding_arg = Arg::with_name("encoding")
.long("encoding")
.takes_value(true)
.possible_values(&["base64", "base64+zstd", "jsonParsed"])
.default_value("base64")
.help("Print account data in specified format when printing account contents.");
let rent = Rent::default();
let default_bootstrap_validator_lamports = &sol_to_lamports(500.0)
.max(VoteState::get_rent_exempt_reserve(&rent))
@ -1676,15 +1683,7 @@ fn main() {
.requires("accounts")
.help("Do not print account data when printing account contents."),
)
.arg(
Arg::with_name("encoding")
.long("encoding")
.takes_value(true)
.possible_values(&["base64", "base64+zstd", "jsonParsed"])
.default_value("base64")
.requires("accounts")
.help("Print account data in specified format when printing account contents."),
)
.arg(&accounts_data_encoding_arg.clone().requires("accounts"))
)
.subcommand(
SubCommand::with_name("genesis-hash")
@ -2018,6 +2017,7 @@ fn main() {
.arg(&halt_at_slot_arg)
.arg(&hard_forks_arg)
.arg(&geyser_plugin_args)
.arg(&accounts_data_encoding_arg)
.arg(
Arg::with_name("include_sysvars")
.long("include-sysvars")
@ -2034,13 +2034,6 @@ fn main() {
.long("no-account-data")
.takes_value(false)
.help("Do not print account data when printing account contents."),
).arg(
Arg::with_name("encoding")
.long("encoding")
.takes_value(true)
.possible_values(&["base64", "base64+zstd", "jsonParsed"])
.default_value("base64")
.help("Print account data in specified format when printing account contents."),
)
.arg(&max_genesis_archive_unpacked_size_arg)
).subcommand(