fix: accept yes/no on --encrypt for Classic parity - #450
Open
jacalata wants to merge 2 commits into
Open
Conversation
tabcmd Classic's `--encrypt` on `createextracts` takes an explicit yes/no value; tabcmd 2 treated it as a bare boolean flag, silently ignoring any following value. Scripts that pass `--encrypt no` on Classic ended up encrypting on tabcmd 2 because argparse consumed the "no" as a positional or bailed. Make --encrypt accept an optional yes|no|true|false argument (case-insensitive). Bare `--encrypt` still means True; omitted means False; explicit `--encrypt no` means False. This preserves current tabcmd 2 default behavior while matching Classic syntax.
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.
Motivation
tabcmd Classic's
--encryptoncreateextractstakes an explicityesornovalue. tabcmd 2 treated it as a bare boolean flag,silently ignoring any following value. Scripts passing
--encrypt noon Classic didn't fail on tabcmd 2 but produced the wrong behavior
(they either bailed on argparse or silently kept encryption on).
Behavior change
For users:
--encryptaccepts an optionalyes|no|true|falseargument (case-insensitive).
--encryptstill meansTrue(tabcmd 2 syntax).False.--encrypt no(orfalse/0) now meansFalse.Preserves tabcmd 2's current default while accepting Classic's
yes/no syntax.
Test plan
tests/parsers/test_parser_create_extracts.py— 8 new tests:omitted / bare / yes / no / true / false / case-insensitive /
bad-value-rejected
test_parser_create_extracts.pysuite: 15 passed🤖 Generated with Claude Code