From 30a5ee202dc104d177d9762924e46ca65f21cf6e Mon Sep 17 00:00:00 2001 From: "Ryan C. Shoemaker" <45581085+RCShoemaker@users.noreply.github.com> Date: Mon, 12 Oct 2026 10:42:53 -0600 Subject: [PATCH 1/2] fix(cli): render refuses an unknown option instead of writing it as a file (#235) `deckcraft-cli render` took any argument it didn't recognise as the output path, so `render deck.pptx --help` rendered the slide into a file named `--help`, and a mistyped option was silently ignored. An argument starting with `-` that render doesn't know is now an error naming it. Co-Authored-By: Claude Opus 5.5 --- apps/deckcraft-cli/src/main.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/apps/deckcraft-cli/src/main.rs b/apps/deckcraft-cli/src/main.rs index c450393f..43cf7966 100644 --- a/apps/deckcraft-cli/src/main.rs +++ b/apps/deckcraft-cli/src/main.rs @@ -127,6 +127,7 @@ fn render(args: &[String]) -> Result<(), String> { "--all" => all = true, "--edit" => edit = true, "--scale" => scale = it.next().and_then(|v| v.parse().ok()).ok_or("--scale needs a number")?, + other if other.len() > 1 && other.starts_with('-') => return Err(format!("unknown render option `{other}`")), other if input.is_none() && !sample @@ -278,3 +279,20 @@ fn mcp(args: &[String]) -> Result<(), String> { let stdin = std::io::stdin(); server.serve(stdin.lock(), std::io::stdout()).map_err(|e| e.to_string()) } + +#[cfg(test)] +mod tests { + use super::*; + + #[test] + fn render_refuses_an_unknown_option_instead_of_writing_it_as_a_file() { + let out = std::env::temp_dir().join("deckcraft-cli-unknown-option.png"); + let _ = std::fs::remove_file(&out); + for flag in ["--bogus", "-x", "--help"] { + let args: Vec = ["--sample", flag, &out.to_string_lossy()].iter().map(|a| a.to_string()).collect(); + let e = render(&args).unwrap_err(); + assert!(e.contains(&format!("unknown render option `{flag}`")), "{flag}: {e}"); + assert!(!out.exists(), "{flag}: rendered anyway"); + } + } +} From 837e60ce651fb068f9ba2043004f46c57367b1c1 Mon Sep 17 00:00:00 2001 From: "Ryan C. Shoemaker" <45581085+RCShoemaker@users.noreply.github.com> Date: Mon, 12 Oct 2026 10:42:53 -0600 Subject: [PATCH 2/2] Contributors: add my name (RCShoemaker) Co-Authored-By: Claude Opus 5.5 --- contributors/people.toml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contributors/people.toml b/contributors/people.toml index b852df13..92fd2399 100644 --- a/contributors/people.toml +++ b/contributors/people.toml @@ -37,3 +37,6 @@ sync_github_name = false [people.Johannesgauss] sync_github_name = true + +[people.RCShoemaker] +real_name = "Ryan C. Shoemaker"