Merge PR #258 from RCShoemaker: fix(cli): render refuses an unknown option instead of writing it as a file (#235)

# Conflicts:
#	apps/deckcraft-cli/src/main.rs
#	contributors/people.toml
This commit is contained in:
Brandon Thomas
2026-10-14 14:34:57 -04:00
2 changed files with 15 additions and 0 deletions
+12
View File
@@ -570,6 +570,18 @@ mod tests {
assert!(describe(Some("--help")).is_ok());
assert!(mcp(&args(&["-h"])).is_ok());
}
#[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"] {
let args: Vec<String> = ["--sample", flag, &out.to_string_lossy()].iter().map(|a| a.to_string()).collect();
let e = render(&args).unwrap_err();
assert!(e.contains(&format!("unknown option `{flag}`")), "{flag}: {e}");
assert!(!out.exists(), "{flag}: rendered anyway");
}
}
}
#[cfg(test)]
+3
View File
@@ -48,3 +48,6 @@ sync_github_name = true
[people.Momentum96]
sync_github_name = true
[people.RCShoemaker]
real_name = "Ryan C. Shoemaker"