Problem
Commands pluck known flags with get_flag/has_flag but never validate that all passed --flags were consumed. A typo'd or unsupported flag is silently ignored:
forgejo issue edit OWNER/REPO 42 --lables=bug # typo: silently does nothing
forgejo pr merge OWNER/REPO 17 --squash # wrong form: ignored, default method used
This is the same "silent no-op" class fixed in #7 (fields the API drops), but at the CLI-parsing layer. Extends the project rule: don't no-op anything — fail loudly.
Why it's deferred
There's no central argument parser; each verb reads flags ad hoc. Loud rejection of unknown flags requires each command to declare its known-flag set (or a shared parser that takes an allow-list), plus care around positional args and forgejo api's gh-style -f/-F passthrough.
Sketch
- A helper like
reject_unknown_flags "<space-separated known flags>" "$@" that scans remaining --* tokens and errors with the offending flag + the command's usage line.
- Roll out per verb (start with the high-traffic ones: issue/pr/repo edit & create).
forgejo api is exempt (its -f/-F are the documented surface).
Acceptance
forgejo issue edit OWNER/REPO 42 --lables=bug exits non-zero naming --lables and printing the usage line, instead of reporting success.
Problem
Commands pluck known flags with
get_flag/has_flagbut never validate that all passed--flagswere consumed. A typo'd or unsupported flag is silently ignored:This is the same "silent no-op" class fixed in #7 (fields the API drops), but at the CLI-parsing layer. Extends the project rule: don't no-op anything — fail loudly.
Why it's deferred
There's no central argument parser; each verb reads flags ad hoc. Loud rejection of unknown flags requires each command to declare its known-flag set (or a shared parser that takes an allow-list), plus care around positional args and
forgejo api's gh-style-f/-Fpassthrough.Sketch
reject_unknown_flags "<space-separated known flags>" "$@"that scans remaining--*tokens and errors with the offending flag + the command's usage line.forgejo apiis exempt (its-f/-Fare the documented surface).Acceptance
forgejo issue edit OWNER/REPO 42 --lables=bugexits non-zero naming--lablesand printing the usage line, instead of reporting success.