Replace clap with lexopt in mls_validation_service - #4003
Open
kejan2514 wants to merge 8 commits into
Open
Conversation
Contributor
|
Hello! Thanks for your PR. You have a few failing CI stemming from MLS Validation Service that need to be fixed |
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
clapwith the lighter-weightlexoptparser inmls_validation_serviceLOG_FORMATenvironment variable support--helphandling without theclapdependencyWhy
mls_validation_serviceonly needs a small command-line interface, so usinglexoptavoids pulling in the heavierclapdependency for this binary.Closes #1109
Testing
The change is scoped to CLI argument parsing and preserves the existing configuration behavior and defaults.
Note
Replace
clapwithlexoptfor CLI argument parsing inmls_validation_serviceclapdependency from apps/mls_validation_service/Cargo.toml and replaces it withlexopt = "0.3.2".Args::parse()in config.rs usinglexopt, preserving all existing flags (--port,--health-check-port,--chain-urls,--cache-size,--log-format) and env var support (LOG_FORMAT).print_helpfunction that prints a static usage message when-h/--helpis passed, then exits with code 0.Args::parse()is now fallible; CLI errors propagate out ofmainas a returned error instead ofclapprinting and exiting internally.Macroscope summarized c5e823d.