From f2ebe3adf345bed844212ad4742b1bc6a874c238 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 22 Dec 2023 21:02:51 +0100 Subject: [PATCH] Make `snapshot_path` an alias Otherwise you can pass `--path` and `--snapshot-path` together and get confused. --- core/src/state.rs | 23 ++++------------------- 1 file changed, 4 insertions(+), 19 deletions(-) diff --git a/core/src/state.rs b/core/src/state.rs index d087c9c3934..516c6936342 100644 --- a/core/src/state.rs +++ b/core/src/state.rs @@ -127,11 +127,7 @@ impl LiveState { pub enum State { /// Use a state snapshot as the source of runtime state. Snap { - /// DEPRECATED: use `--path` instead. - #[arg(short, long)] - snapshot_path: Option, - - #[clap(short = 'p', long = "path")] + #[clap(short = 'p', long = "path", alias = "snapshot-path")] path: Option, }, @@ -168,22 +164,11 @@ impl State { ::Err: Debug, { let builder = match self { - State::Snap { - snapshot_path, - path, - } => { - // we allow both `--snapshot-path` and `--path` for now, but `--snapshot-path` is - // deprecated. - if snapshot_path.is_some() { - log::warn!( - target: LOG_TARGET, - "`--snapshot-path` is deprecated and will be removed some time after Jan 2024. Use `--path` instead." - ); - } - let path = snapshot_path + State::Snap { path } => { + let path = path .as_ref() - .or(path.as_ref()) .ok_or_else(|| "no snapshot path provided".to_string())?; + Builder::::new().mode(Mode::Offline(OfflineConfig { state_snapshot: SnapshotConfig::new(path), }))