Skip to content

Migrate from structopt to clap#320

Merged
fitzgen merged 2 commits into
bytecodealliance:mainfrom
posborne:structopt-to-clap
Jun 25, 2026
Merged

Migrate from structopt to clap#320
fitzgen merged 2 commits into
bytecodealliance:mainfrom
posborne:structopt-to-clap

Conversation

@posborne

Copy link
Copy Markdown
Collaborator

Structopt is long deprecated and unmaintained; it's features were rolled into clap's derive functionality, though with a few small differences. I added some additional, basic test coverage and then migrated the cli to use clap.

posborne added 2 commits June 25, 2026 06:33
Add --help smoke tests for all subcommands, and CLI-level tests for the
four previously untested subcommands (effect-size, summarize, clean,
validate). Extend benchmark tests to cover flags that had no coverage:
--output-file, --name, --engine-flags, --measure, --small-workloads,
--pin, --keep-logs, --working-dir.

Also fix a TOCTOU race in the clean subcommand where remove_file would
fail if a log file disappeared between directory enumeration and
removal; NotFound errors are now silently ignored.
Structopt is no longer maintained; the port to use clap
with proc-macro derives is fairly straightforward.  The tests
added in the previous commit provide fairly good coverage for
the migration.
@posborne posborne requested a review from fitzgen June 25, 2026 06:53

@fitzgen fitzgen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thanks! Long overdue

@fitzgen fitzgen merged commit 4032a03 into bytecodealliance:main Jun 25, 2026
12 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