nikivdev/code · error

unknown `f pr feedback` option: {token}

Error message

unknown `f pr feedback` option: {token}

What it means

The `f pr feedback` subcommand parses tokens positionally: known flags are matched, and any token starting with `--` that isn't recognized is rejected with this error. Only PR selectors (non-flag tokens) are accepted otherwise. It is an argument-validation guard against typos in option names.

Source

Thrown at src/commit.rs:9873

    let mut record_todos = false;
    let mut show_full = true;
    let mut open_cursor = false;
    for token in args.iter().skip(1) {
        match token.as_str() {
            "--todo" | "todo" => record_todos = true,
            "--full" | "full" => show_full = true,
            "--compact" | "compact" => show_full = false,
            "--cursor" | "cursor" => open_cursor = true,
            "--help" | "-h" => {
                return Ok(Some(PrFeedbackCommand {
                    selector: Some("--help".to_string()),
                    record_todos: false,
                    show_full: true,
                    open_cursor: false,
                }));
            }
            _ if token.starts_with("--") => {
                bail!("unknown `f pr feedback` option: {token}");
            }
            _ => {
                if selector.is_some() {
                    bail!("multiple PR selectors provided. Use exactly one selector.");
                }
                selector = Some(token.clone());
            }
        }
    }

    Ok(Some(PrFeedbackCommand {
        selector,
        record_todos,
        show_full,
        open_cursor,
    }))
}

View on GitHub (pinned to a747e741ae)

Solutions

  1. Check `f pr feedback --help` for the supported options and fix the flag spelling.
  2. Remove the unrecognized flag and re-run.
  3. Quote or fix the shell variable that expanded into the bad token.

Example fix

// before
f pr feedback --ful PR-123
// after
f pr feedback --show-full PR-123
Defensive patterns

Strategy: validation

Validate before calling

const KNOWN = new Set(["--show-full", "--todos", "--no-todos"]);
const bad = tokens.filter(t => t.startsWith("--") && !KNOWN.has(t));
if (bad.length) throw new Error(`unknown option(s): ${bad.join(", ")}`);

Try / catch

try { await feedback(args); }
catch (e) {
  if (String(e).includes("unknown `f pr feedback` option")) {
    console.error("Check `f pr feedback --help` for valid flags");
  } else throw e;
}

Prevention

When it happens

Trigger: Passing an unsupported flag to `f pr feedback`, e.g. a misspelled `--ful` instead of `--full`, or a flag belonging to another subcommand; scripting errors injecting extra flags.

Common situations: Typo in a long option (`--shw-full`), copying flags from `f pr` into `f pr feedback`, shell variable expanding into an unexpected flag token.

Related errors


AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01). Data as JSON: /api/errors/31a175a934d4ba75. Report an issue: GitHub.