Skip to content

Refactor RAPx CLI with enhanced argument parsing and help messages#229

Merged
hxuhack merged 9 commits intosafer-rust:mainfrom
WIZeaz:clap-cli
Mar 2, 2026
Merged

Refactor RAPx CLI with enhanced argument parsing and help messages#229
hxuhack merged 9 commits intosafer-rust:mainfrom
WIZeaz:clap-cli

Conversation

@WIZeaz
Copy link
Contributor

@WIZeaz WIZeaz commented Mar 1, 2026

This PR introduces several improvements to the RAPx CLI:

  • Refactors the RAPx CLI to enhance usability and provide more robust command-line option handling by adopting Clap for argument parsing.
  • Updates rapx to read RAPx-specific arguments from the RAPFLAGS environment variable, allowing it to better mimic rustc behavior. This also lays the groundwork for a future feature enabling rapx to analyze a single Rust source file directly.
  • Uses the CARGO_PRIMARY_PACKAGE environment variable to determine whether rapx is running in the rustc wrapper phase. This replaces the previous heuristic-based approach with a more accurate and reliable mechanism.
  • Introduces a cli::RapxArgs struct that declaratively defines the CLI structure and associated command-line parameters, serving as the central configuration model for argument parsing and analysis setup.
  • Updates the README to document the new CLI behavior and usage patterns.
  • Updates rapx version to 0.7.0

- Added Clap for command-line argument parsing, enhancing usability and consistency with Cargo.
- Introduced a new configuration module to manage command options and analysis types.
- Removed deprecated help file and integrated help messages directly into the CLI structure.
- Streamlined the analysis process by consolidating various analysis options into a unified command structure.
- Updated the main execution flow to accommodate new command parsing and analysis initiation.
- Removed unused functions and cleaned up the codebase for better maintainability.
- Enhanced logging and error handling throughout the application.
@WIZeaz WIZeaz marked this pull request as ready for review March 1, 2026 20:51
@hxuhack hxuhack merged commit 8a3798d into safer-rust:main Mar 2, 2026
1 check passed
@WIZeaz WIZeaz deleted the clap-cli branch March 2, 2026 17:25
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.

2 participants