From 1d6d1da0a9e7a956aaa703e67fc31df56fff76cc Mon Sep 17 00:00:00 2001 From: Ivan Date: Sat, 17 Oct 2026 18:13:32 +0300 Subject: [PATCH] refactor(cli): drop duplicate --in-place help and a panicking matches lookup (#7071) batch --help printed the "--out that is the --in folder is refused" sentence twice, in the subcommand's long help and on --in-place. Keep it on the flag, where -h shows it too. steps() read --cmd/--params with get_many, which panics on a type mismatch, against the crate's never-panic rule. Use try_get_many and treat an error as no values; behaviour is otherwise the same. Co-authored-by: Claude Opus 5.5 --- apps/photocraft-cli/src/args.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/apps/photocraft-cli/src/args.rs b/apps/photocraft-cli/src/args.rs index 13487c5a2c..d15327e03e 100644 --- a/apps/photocraft-cli/src/args.rs +++ b/apps/photocraft-cli/src/args.rs @@ -130,9 +130,6 @@ pub(crate) struct RunArgs { /// droplet). An Actions set (the Actions panel's actions.json, {"actions": [{"name", "steps"}…]}) /// plays the action --action names (needed when the set holds more than one) with the whole set /// loaded, so its steps can play other actions of the set. -/// -/// An --out folder that is the --in folder is refused, as the results would replace the -/// originals; --in-place allows it. #[derive(Args)] pub(crate) struct BatchArgs { /// The action list: actions.json, a droplet, or a Photoshop Actions file (.atn) @@ -228,7 +225,7 @@ pub(crate) struct ServeArgs { fn steps(m: &ArgMatches) -> Vec<(bool, String)> { let mut steps: Vec<(usize, bool, String)> = Vec::new(); for (id, is_cmd) in [("cmd", true), ("params", false)] { - if let (Some(at), Some(values)) = (m.indices_of(id), m.get_many::(id)) { + if let (Some(at), Some(values)) = (m.indices_of(id), m.try_get_many::(id).ok().flatten()) { steps.extend(at.zip(values).map(|(i, v)| (i, is_cmd, v.clone()))); } }