Repository navigation
refactor(cli): parse sqb arguments natively - #1096
Merged
Merged
Conversation
…output Move argv parsing, help/usage/error formatting and parse_cli_invocation's post-parse rules into a Rust argv domain in sqlbuild-cli, driven by an embedded command table, and expose it through _native.parse_cli_arguments. Delete the Python argparse parser, its argument helpers and the coded parser class.
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.
Why
Phase 3 of the Rust-hosted SQLBuild port (CHI-592), step 1:
sqbargument parsing moves from Python argparse to Rust, removing the Python parser definitions.Changes
crates/sqlbuild-cli/src/argv/, driven by an embedded command table (command_table.json) that now defines every command and option.SQLBUILD_CONCURRENCYdefault, cursor/scope/test/janitor checks._native.parse_cli_arguments;parse_cli_invocationis a thin wrapper.parser.py,parser_arguments.py,sqlbuild_argument_parser.pyand the parsing logic inparsing.py/errors.py.Intentional differences (accepted, recorded on CHI-592):
--help/--version(~3 ms).Verification
SQLBUILD_CONCURRENCYvariants.cargo test -p sqlbuild-cli;make check-ci; hygiene scan.