From b3ea62fba31767fae75238a714081ab924cc6fbc Mon Sep 17 00:00:00 2001 From: steviez Date: Tue, 30 Jan 2024 22:50:37 -0400 Subject: [PATCH] ledger-tool: Change --snapshot-archive-path to --snapshots (#35019) This change makes solana-ledger-tool match solana-validator CLI; the old flag --snapshot-archive-path is retained as an argument alias and can still be used for the sake of backwards compatibility. --- ledger-tool/src/main.rs | 9 +++++---- ledger-tool/src/program.rs | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ledger-tool/src/main.rs b/ledger-tool/src/main.rs index 50bc3a40263743..d4a5a3eb18ea69 100644 --- a/ledger-tool/src/main.rs +++ b/ledger-tool/src/main.rs @@ -819,12 +819,13 @@ fn main() { ), ) .arg( - Arg::with_name("snapshot_archive_path") - .long("snapshot-archive-path") + Arg::with_name("snapshots") + .long("snapshots") + .alias("snapshot-archive-path") .value_name("DIR") .takes_value(true) .global(true) - .help("Use DIR for snapshot location"), + .help("Use DIR for snapshot location [default: --ledger value]"), ) .arg( Arg::with_name("incremental_snapshot_archive_path") @@ -1420,7 +1421,7 @@ fn main() { info!("{} {}", crate_name!(), solana_version::version!()); let ledger_path = PathBuf::from(value_t_or_exit!(matches, "ledger_path", String)); - let snapshot_archive_path = value_t!(matches, "snapshot_archive_path", String) + let snapshot_archive_path = value_t!(matches, "snapshots", String) .ok() .map(PathBuf::from); let incremental_snapshot_archive_path = diff --git a/ledger-tool/src/program.rs b/ledger-tool/src/program.rs index 732c2e8fe3aaee..b56affd4c905c2 100644 --- a/ledger-tool/src/program.rs +++ b/ledger-tool/src/program.rs @@ -71,7 +71,7 @@ fn load_accounts(path: &Path) -> Result { fn load_blockstore(ledger_path: &Path, arg_matches: &ArgMatches<'_>) -> Arc { let process_options = parse_process_options(ledger_path, arg_matches); - let snapshot_archive_path = value_t!(arg_matches, "snapshot_archive_path", String) + let snapshot_archive_path = value_t!(arg_matches, "snapshots", String) .ok() .map(PathBuf::from); let incremental_snapshot_archive_path =