Skip to content

fix: distinguish bare bool flags from explicit empty value#14

Merged
ChenJesse merged 1 commit into
mainfrom
jesse/fix-bare-bool-explicit-empty
May 27, 2026
Merged

fix: distinguish bare bool flags from explicit empty value#14
ChenJesse merged 1 commit into
mainfrom
jesse/fix-bare-bool-explicit-empty

Conversation

@ChenJesse
Copy link
Copy Markdown
Contributor

@ChenJesse ChenJesse commented May 27, 2026

Summary

Follow-up to #13. The previous fix treated both --flag (bare) and --flag= (explicit empty) as true. This is wrong — --flag=$UNSET_VAR expanding to --flag= should not silently activate the flag.

Now only truly bare flags (len(splitFlag) == 1, no = present) default to true.

Test plan

  • New test: --flag= does not default to true
  • Existing test: bare --flag still treated as true
  • All TestParseTaskOptionsListToMap subtests pass

🤖 Generated with Claude Code


View with Codesmith Autofix with Codesmith
Need help on this PR? Tag @codesmith with what you need. Autofix is disabled.

--flag (bare, no =) → true
--flag= (explicit empty) → falls through to default

Prevents --flag=$UNSET_VAR from silently being treated as true.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@ChenJesse ChenJesse merged commit 1841fad into main May 27, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant