Skip to content

refactor: switch CLI argument parsing to clap#27

Merged
ppenna merged 1 commit intohyperlight-dev:mainfrom
jsturtevant:copilot-worktree-2026-02-04T22-14-46
Feb 5, 2026
Merged

refactor: switch CLI argument parsing to clap#27
ppenna merged 1 commit intohyperlight-dev:mainfrom
jsturtevant:copilot-worktree-2026-02-04T22-14-46

Conversation

@jsturtevant
Copy link
Contributor

Replaces manual command-line argument parsing with clap derive macros.

Changes

  • Add clap dependency with derive feature
  • Define Cli struct with clap attributes for argument parsing
  • Convert --setup-registry and --clear-registry flags to subcommands (setup-registry, clear-registry)
  • Maintain --verbose as a flag
  • Script path is now a positional argument

Usage

# Run scripts
cargo run -- guest-examples/hello.js
cargo run -- --verbose guest-examples/hello.py

# Subcommands
cargo run -- setup-registry
cargo run -- clear-registry

# Help
cargo run -- --help

@jsturtevant
Copy link
Contributor Author

should retrigger ci once #26 is in

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the CLI argument parsing from manual implementation to using the clap derive macros, improving maintainability and user experience.

Changes:

  • Replaces manual argument parsing with clap's derive API
  • Converts --setup-registry and --clear-registry flags to subcommands
  • Changes script path from a searched argument to a proper positional parameter

Reviewed changes

Copilot reviewed 1 out of 3 changed files in this pull request and generated no comments.

File Description
Cargo.toml Adds clap dependency with derive feature
Cargo.lock Adds clap and its dependencies to the lock file
src/bin/hyperlight-nanvix.rs Implements clap-based CLI with Cli struct, Commands enum, and updated main function

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 3 out of 5 changed files in this pull request and generated no new comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
@jsturtevant jsturtevant force-pushed the copilot-worktree-2026-02-04T22-14-46 branch from ecb2f1f to 0027169 Compare February 5, 2026 18:53
@ppenna ppenna merged commit e5fa6b3 into hyperlight-dev:main Feb 5, 2026
4 checks passed
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