describe keeps a remark with its option and allows a bare call

animation.remove's remark belongs to its `ids` option, so describe shows
it there instead of as a note on the whole command. A command with an
all-optional set of parameters is suggested as a bare id.

[claude-opus-5-5] on behalf of hoblin
This commit is contained in:
Yevhenii Hurin
2026-10-13 09:55:19 +03:00
parent 426fd71bd2
commit 922445300b
3 changed files with 6 additions and 2 deletions
+2 -1
View File
@@ -252,7 +252,8 @@ fn describe(id: Option<&str>) -> Result<(), String> {
if !answer.trim().is_empty() {
outln!("Answers with {}.", answer.trim());
}
let call = if params.iter().all(|p| p.optional) { c.id.to_string() } else { format!("'{}={{…}}'", c.id) };
let bare = params.is_empty() || params.iter().any(|p| params.iter().filter(|q| q.object == p.object).all(|q| q.optional));
let call = if bare { c.id.to_string() } else { format!("'{}={{…}}'", c.id) };
outln!("\nRun it with: deckcraft-cli run --cmd {call}");
Ok(())
}