Skip to content

Commit

Permalink
ledger-tool: Change --snapshot-archive-path to --snapshots (solana-la…
Browse files Browse the repository at this point in the history
…bs#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.
  • Loading branch information
steviez authored Jan 31, 2024
1 parent 0dcac3f commit b3ea62f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
9 changes: 5 additions & 4 deletions ledger-tool/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion ledger-tool/src/program.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ fn load_accounts(path: &Path) -> Result<Input> {

fn load_blockstore(ledger_path: &Path, arg_matches: &ArgMatches<'_>) -> Arc<Bank> {
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 =
Expand Down

0 comments on commit b3ea62f

Please sign in to comment.