mirror of
https://github.com/storytold/deckcraft.git
synced 2026-10-28 12:36:56 -06:00
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:
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user