fix(coding-agent): support all-argument prompt defaults closes #6695

This commit is contained in:
David Brailovsky
2026-07-17 13:52:32 +02:00
parent ce48d9b4ef
commit 64f83c85d9
4 changed files with 17 additions and 5 deletions
@@ -199,6 +199,15 @@ describe("substituteArgs - positional defaults", () => {
expect(substituteArgs(`List exactly \${1:-7} next steps`, [])).toBe("List exactly 7 next steps");
});
test("should support defaults for all arguments", () => {
const template = `\${@:-default}\n\${ARGUMENTS:-default}`;
expect(substituteArgs(template, [])).toBe("default\ndefault");
expect(substituteArgs(template, ["This", "would", "be", "the", "arguments"])).toBe(
"This would be the arguments\nThis would be the arguments",
);
});
test("should use positional arg when present", () => {
expect(substituteArgs(`List exactly \${1:-7} next steps`, ["3"])).toBe("List exactly 3 next steps");
});