Repository navigation
fix(cli): refuse a boolean flag's value that citty would not read - #223
Merged
neoromantic merged 1 commit intoNov 19, 2026
Merged
neoromantic merged 1 commit into
neoromantic merged 1 commit into
Conversation
citty reads --silent=no, --silent=0 and --silent= as --silent, drops the value of --no-silent=false and reads -q=false as -q. The args check now refuses these with INVALID_ARGS, as it does --silent false; --flag=true and --flag=false still work. The message for a negated flag that got a value names --silent and --no-silent, not --no-no-silent. Co-Authored-By: Claude Fable 5.2 <[email protected]>
3 tasks done
ertembiyik
pushed a commit
to ertembiyik/telegram-sync-cli
that referenced
this pull request
Nov 20, 2026
0.15.0 is published, so the entry from neoromantic#223 moves out of its section. Refs neoromantic#217 Co-Authored-By: Claude Opus 5.5 <[email protected]>
3 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
A follow-up to #220 (Refs #217). The args check refuses
--silent false, but the same value written with=still gets through, and citty does not read it:--silent=no,--silent=0,--silent=,--silent=False--silent--no-silent=false--no-silent-q=false-qSo
tg send --silent=nosends silently. The check now returnsINVALID_ARGS(exit 3) for these before the command runs.--flag=trueand--flag=falseare read as written and still work, as do--no-flag=trueand-q=true.One more line in the same message:
--no-silent falseused to suggest--no-silent or --no-no-silent; it now names--silent or --no-silent.tg apiandtg sqlare not checked, as before.If this lands, the
--revoke=<value>check in #190 becomes a duplicate and I will remove it there.How I checked it
citty's reading of each form in the table:
parseArgsrun by hand on a boolean flag with a default and one with an alias.src/utils/args.test.ts: six new cases, all failing onmainbefore the change (--silent=no,--silent=0,--silent=,--no-silent=false,-q=false, and the message for--no-silent false). The case of accepted forms now also has--html=truebeside--silent=false.src/test/access.e2e.test.ts:tg send --to me -m hi --silent=noisINVALID_ARGSwith exit 3 before connecting.bun run check: clean.bun run test: 1212 pass, 0 fail.bun run test:e2e: 339 pass, 0 fail.Tests pass locally and use made-up data only
README, docs and affected demos follow the product content standard (
docs/api-design.md, CHANGELOG)Title follows the repo's commit style: Conventional Commits (
feat: …,fix: …) unlessAGENTS.mdsays otherwise🤖 Generated with Claude Code