You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bunli silently ignores unknown flags (parser.ts line 51: continue). Misspelled subcommands get suggestions (already implemented via Levenshtein), but misspelled flags do not. The Levenshtein threshold is also too generous at 3.
Solution
Add "did you mean?" suggestions for both flags and subcommands using Levenshtein distance ≤ 2:
$ mycli depoly --verbos
Error: unknown subcommand "depoly"
Did you mean "deploy"?
Error: unknown option "--verbos"
Did you mean "--verbose"?
Design
Tighten threshold in utils/levenshtein.ts: change from 3 to 2
Track unknown flags in parser.ts:
Instead of continue on unknown flags, compute suggestion via findSuggestion(name, Object.keys(options))
Problem
Bunli silently ignores unknown flags (parser.ts line 51:
continue). Misspelled subcommands get suggestions (already implemented via Levenshtein), but misspelled flags do not. The Levenshtein threshold is also too generous at 3.Solution
Add "did you mean?" suggestions for both flags and subcommands using Levenshtein distance ≤ 2:
Design
Tighten threshold in
utils/levenshtein.ts: change from 3 to 2Track unknown flags in
parser.ts:continueon unknown flags, compute suggestion viafindSuggestion(name, Object.keys(options))ParsedArgsresult:Integrate with error accumulation (Issue feat: type-safe code generation and comprehensive documentation overhaul #3):
shortToNamemapSubcommands already have Levenshtein — just tighten the threshold
Edge cases
--helpnever triggers suggestion--are positional → no suggestions-xunknown, suggest based on known short flag valuesFiles
packages/core/src/utils/levenshtein.ts— threshold 3 → 2packages/core/src/parser.ts— track unknown flags with suggestionspackages/core/src/cli.ts— render unknown flag errors with suggestionsDepends on