Skip to content

Replace clap with lexopt in mls_validation_service - #4003

Open
kejan2514 wants to merge 8 commits into
xmtp:mainfrom
kejan2514:fix/1109-replace-clap-with-lexopt
Open

Replace clap with lexopt in mls_validation_service#4003
kejan2514 wants to merge 8 commits into
xmtp:mainfrom
kejan2514:fix/1109-replace-clap-with-lexopt

Conversation

@kejan2514

@kejan2514 kejan2514 commented Aug 16, 2026

Copy link
Copy Markdown

Summary

  • replace clap with the lighter-weight lexopt parser in mls_validation_service
  • preserve the existing CLI options and default values
  • preserve LOG_FORMAT environment variable support
  • add explicit --help handling without the clap dependency

Why

mls_validation_service only needs a small command-line interface, so using lexopt avoids pulling in the heavier clap dependency for this binary.

Closes #1109

Testing

The change is scoped to CLI argument parsing and preserves the existing configuration behavior and defaults.

Note

Replace clap with lexopt for CLI argument parsing in mls_validation_service

  • Removes the clap dependency from apps/mls_validation_service/Cargo.toml and replaces it with lexopt = "0.3.2".
  • Rewrites Args::parse() in config.rs using lexopt, preserving all existing flags (--port, --health-check-port, --chain-urls, --cache-size, --log-format) and env var support (LOG_FORMAT).
  • Adds a print_help function that prints a static usage message when -h/--help is passed, then exits with code 0.
  • Behavioral Change: Args::parse() is now fallible; CLI errors propagate out of main as a returned error instead of clap printing and exiting internally.

Macroscope summarized c5e823d.

@kejan2514
kejan2514 requested a review from a team as a code owner August 16, 2026 20:21
@insipx

insipx commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

Hello! Thanks for your PR. You have a few failing CI stemming from MLS Validation Service that need to be fixed

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.

Replace clap with lexopt in mls_validation_service

2 participants