Skip to content

Commit b8b3af6

Browse files
committed
fix(#758): --cwd, --date, --session missing-value errors now use missing_flag_value prefix + hint
1 parent 02d77ae commit b8b3af6

2 files changed

Lines changed: 10 additions & 7 deletions

File tree

ROADMAP.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7681,3 +7681,5 @@ Original filing (2026-04-18): the session emitted `SessionStart hook (completed)
76817681
756. **`--reasoning-effort bogus`, `--model` (no value), and sibling missing/invalid flag-value errors all returned `error_kind:"unknown"` + `hint:null`** — gaebal-gajae pinpoint on `0e8a449e`. All `missing value for --X` and `invalid value for --reasoning-effort` error strings were single-line with no classifier arm. Fix: (a) prefix all with `missing_flag_value:` / `invalid_flag_value:` + `\n` usage hint; (b) add `message.starts_with("missing_flag_value:")` → `"missing_flag_value"` and `message.starts_with("invalid_flag_value:")` → `"invalid_flag_value"` classifier arms. Covers `--model`, `--output-format`, `--permission-mode`, `--base-commit`, `--reasoning-effort`. Regression guard: `flag_value_errors_have_error_kind_and_hint_756` — invalid `--reasoning-effort HIGH` → `invalid_flag_value` + hint with valid values; missing `--model` → `missing_flag_value` + non-null hint. Source: gaebal-gajae dogfood on `0e8a449e`, 2026-05-26.
76827682

76837683
757. **`--permission-mode bogus` and `--allowedTools` (no value) returned `error_kind:"unknown"` + `hint:null`** — dogfooded 2026-05-26 on `4df14618`. `parse_permission_mode_arg()` error format had no prefix and no `\n`; `--allowedTools` missing-value string was plain. Fix: prefix `parse_permission_mode_arg` error with `invalid_flag_value:` + `\n` valid-values hint (both call sites); prefix `--allowedTools` missing-value with `missing_flag_value:` + `\n` usage hint. Both now classified by existing `missing_flag_value`/`invalid_flag_value` arms added in #756. Source: Jobdori dogfood on `4df14618`, 2026-05-26.
7684+
7685+
758. **Three remaining `missing value for --X` strings in `parse_init_args` were still untyped** — dogfooded 2026-05-26 on `02d77ae1`. `--cwd`, `--date`, `--session` missing-value errors in the init-args parser used the old plain-string form with no `missing_flag_value:` prefix and no `\n` hint, unlike the main `parse_args` flags fixed in #756/#757. Fix: applied `missing_flag_value:` prefix + `\n` usage hint to all three. `grep '"missing value for --'` now returns zero results outside of test assertions. Source: Jobdori dogfood sweep on `02d77ae1`, 2026-05-26.

rust/crates/rusty-claude-cli/src/main.rs

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1949,16 +1949,17 @@ fn parse_system_prompt_args(
19491949
while index < args.len() {
19501950
match args[index].as_str() {
19511951
"--cwd" => {
1952-
let value = args
1953-
.get(index + 1)
1954-
.ok_or_else(|| "missing value for --cwd".to_string())?;
1952+
let value = args.get(index + 1).ok_or_else(|| {
1953+
"missing_flag_value: missing value for --cwd.\nUsage: --cwd <path>".to_string()
1954+
})?;
19551955
cwd = PathBuf::from(value);
19561956
index += 2;
19571957
}
19581958
"--date" => {
1959-
let value = args
1960-
.get(index + 1)
1961-
.ok_or_else(|| "missing value for --date".to_string())?;
1959+
let value = args.get(index + 1).ok_or_else(|| {
1960+
"missing_flag_value: missing value for --date.\nUsage: --date <YYYY-MM-DD>"
1961+
.to_string()
1962+
})?;
19621963
date.clone_from(value);
19631964
index += 2;
19641965
}
@@ -1991,7 +1992,7 @@ fn parse_export_args(args: &[String], output_format: CliOutputFormat) -> Result<
19911992
"--session" => {
19921993
let value = args
19931994
.get(index + 1)
1994-
.ok_or_else(|| "missing value for --session".to_string())?;
1995+
.ok_or_else(|| "missing_flag_value: missing value for --session.\nUsage: --session <session-id>".to_string())?;
19951996
session_reference.clone_from(value);
19961997
index += 2;
19971998
}

0 commit comments

Comments
 (0)