(866a4eb) Accept prose values that begin with a hyphen, and bump to 0.3.2
clap read any value starting with a hyphen as a flag, so a criterion quoting --print was refused with "unexpected argument found" and no ticket was written at all. Ticket text quotes flag names constantly, and the space form is what both a person and the opencode wrapper produce, so the failure was routine. allow_hyphen_values on the five arguments that carry prose: add --title, --description, --acceptance, --plan, and the comment body. The trade is that a genuinely mistyped flag there now lands as content instead of raising a usage error, which is the right way round for prose and the wrong way round for anything else, so due, priority, tags, owner and status are left alone and still fail with exit 2. Written down in AGENTS.md. The bare double hyphen is the one shape this does not reach: as an option value it is stored as text, but in a positional it is clap's end-of-options marker and is consumed before assignment. A comment body of exactly -- therefore needs its own separator. Without it the body is reported missing and nothing is written, so it is a clear failure rather than a silent drop. Tested, along with the ordering that lets mv reach a hyphen-leading title. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5
parent
b28ddb9210
commit
f5204f6d8b
+16
-4
@@ -37,6 +37,17 @@ pub struct Cli {
|
||||
pub command: Command,
|
||||
}
|
||||
|
||||
/// Arguments that carry prose, and therefore have to accept a value starting with
|
||||
/// a hyphen.
|
||||
///
|
||||
/// Ticket text quotes flag names constantly, and without this a criterion reading
|
||||
/// "--print is supported" is parsed as a flag and the whole ticket is refused. The
|
||||
/// trade, spelled out in AGENTS.md: on these arguments a genuinely mistyped flag
|
||||
/// now lands as content instead of raising a usage error. That is the right way
|
||||
/// round for prose, and it is why `due`, `priority`, `tags`, `owner` and `status`
|
||||
/// are deliberately left without it.
|
||||
const PROSE: bool = true;
|
||||
|
||||
#[derive(clap::Subcommand)]
|
||||
pub enum Command {
|
||||
/// Initialize worklane in the current project
|
||||
@@ -45,19 +56,19 @@ pub enum Command {
|
||||
/// Add a new ticket to the backlog
|
||||
Add {
|
||||
/// Ticket title
|
||||
#[arg(short, long)]
|
||||
#[arg(short, long, allow_hyphen_values = PROSE)]
|
||||
title: String,
|
||||
|
||||
/// Ticket description. Use multiple flags to create multiline descriptions.
|
||||
#[arg(short, long)]
|
||||
#[arg(short, long, allow_hyphen_values = PROSE)]
|
||||
description: Vec<String>,
|
||||
|
||||
/// Acceptance criteria. Accepts multiple flags, each will be interpreted as a single criterium
|
||||
#[arg(short, long)]
|
||||
#[arg(short, long, allow_hyphen_values = PROSE)]
|
||||
acceptance: Vec<String>,
|
||||
|
||||
/// Implementation plan. Accepts multiple flags, each will be interpreted as a single step
|
||||
#[arg(short, long)]
|
||||
#[arg(short, long, allow_hyphen_values = PROSE)]
|
||||
plan: Vec<String>,
|
||||
|
||||
/// Tags (comma-separated)
|
||||
@@ -114,6 +125,7 @@ pub enum Command {
|
||||
ticket: String,
|
||||
|
||||
/// Comment body (required)
|
||||
#[arg(allow_hyphen_values = PROSE)]
|
||||
body: String,
|
||||
|
||||
/// Owner
|
||||
|
||||
Reference in New Issue
Block a user