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:
parent
fa65b50b9a
commit
54fc768fcc
|
@ -1486,6 +1486,13 @@ fn main() {
|
||||||
.multiple(true)
|
.multiple(true)
|
||||||
.help("Specify the configuration file for the Geyser plugin.");
|
.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 rent = Rent::default();
|
||||||
let default_bootstrap_validator_lamports = &sol_to_lamports(500.0)
|
let default_bootstrap_validator_lamports = &sol_to_lamports(500.0)
|
||||||
.max(VoteState::get_rent_exempt_reserve(&rent))
|
.max(VoteState::get_rent_exempt_reserve(&rent))
|
||||||
|
@ -1676,15 +1683,7 @@ fn main() {
|
||||||
.requires("accounts")
|
.requires("accounts")
|
||||||
.help("Do not print account data when printing account contents."),
|
.help("Do not print account data when printing account contents."),
|
||||||
)
|
)
|
||||||
.arg(
|
.arg(&accounts_data_encoding_arg.clone().requires("accounts"))
|
||||||
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."),
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
.subcommand(
|
.subcommand(
|
||||||
SubCommand::with_name("genesis-hash")
|
SubCommand::with_name("genesis-hash")
|
||||||
|
@ -2018,6 +2017,7 @@ fn main() {
|
||||||
.arg(&halt_at_slot_arg)
|
.arg(&halt_at_slot_arg)
|
||||||
.arg(&hard_forks_arg)
|
.arg(&hard_forks_arg)
|
||||||
.arg(&geyser_plugin_args)
|
.arg(&geyser_plugin_args)
|
||||||
|
.arg(&accounts_data_encoding_arg)
|
||||||
.arg(
|
.arg(
|
||||||
Arg::with_name("include_sysvars")
|
Arg::with_name("include_sysvars")
|
||||||
.long("include-sysvars")
|
.long("include-sysvars")
|
||||||
|
@ -2034,13 +2034,6 @@ fn main() {
|
||||||
.long("no-account-data")
|
.long("no-account-data")
|
||||||
.takes_value(false)
|
.takes_value(false)
|
||||||
.help("Do not print account data when printing account contents."),
|
.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)
|
.arg(&max_genesis_archive_unpacked_size_arg)
|
||||||
).subcommand(
|
).subcommand(
|
||||||
|
|
Loading…
Reference in New Issue