Fix #433: accept Classic delete --workbook Name syntax - #451
Open
jacalata wants to merge 1 commit into
Open
Conversation
tabcmd Classic invokes delete as `tabcmd delete --workbook "Name"` where --workbook takes the target name as its value. tabcmd 2 shipped `tabcmd delete "Name" --workbook` (name positional, flag is a type selector). This is a breaking CLI difference for anyone running Classic scripts unchanged. Accept both forms: - Positional name stays optional (nargs="?"). - --workbook/--datasource take an optional value (nargs="?"). Bare form still means True (tabcmd 2 syntax); with a value, the value is the target name (Classic syntax). - In run_command, resolve which form supplied the name and normalize args.workbook/args.datasource to True. Emit the same "requires workbook or datasource" error when neither form supplied a name. Mutual exclusion between --workbook and --datasource still holds. Fixes #433.
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.
Summary
tabcmd delete --workbook "Name"where--workbookcarries the target name as its value. tabcmd 2 shippedtabcmd delete "Name" --workbook(name positional, flag as type selector). This is a breaking CLI difference for anyone running Classic scripts unchanged.namebecomes optional (nargs="?").--workbook/--datasourcetake an optional value (nargs="?"). Bare form still meansTrue(tabcmd 2 syntax); with a value, the value is the target name (Classic syntax).run_command, resolve which form supplied the name and normalizeargs.workbook/args.datasourcetoTrue. Emit the same "requires workbook or datasource" error when neither form supplied a name.--workbookand--datasourcestill holds.Closes #433.
Test plan
tests/parsers/test_parser_delete.py— 4 new tests cover both forms, mutual exclusion, and empty parse🤖 Generated with Claude Code