tooling: Run one command per invocation - #1691
Merged
Merged
Conversation
Contributor
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1691 +/- ##
=======================================
Coverage 97.98% 97.98%
=======================================
Files 181 181
Lines 16211 16212 +1
Branches 3729 3729
=======================================
+ Hits 15884 15885 +1
Misses 248 248
Partials 79 79
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull request overview
Prevents multiple CLI subcommands from being parsed and dispatched in one invocation.
Changes:
- Limits parsing to one subcommand.
- Adds tests for both mixed-command orders.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
tools/evmone/main.cpp |
Enforces at most one subcommand. |
test/integration/CMakeLists.txt |
Tests mixed-command rejection. |
Suppressed comments (1)
test/integration/CMakeLists.txt:39
- This reversed case also uses
PASS_REGULAR_EXPRESSION, which causes CTest to ignore the exit status. A regression that emits this text but exits 0 would therefore pass; pair it with aWILL_FAILinvocation so both command-order error paths verify nonzero status.
set_tests_properties(
${PREFIX}/one_command_per_invocation_reversed PROPERTIES
PASS_REGULAR_EXPRESSION "argument was not expected: t8n"
FAIL_REGULAR_EXPRESSION "Result: *success")
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
A subcommand's own name among another's arguments parsed as a second command, and the dispatch tries run first, so a trailing "run" silently replaced the command asked for: "evmone t8n --state.fork Cancun run 6000" executed bytecode and exited 0. Claude-Session: https://claude.ai/code/session_016UHPAGwcwXMjqhTLpT31K7
stops_at_one_test pinned that the test after the one which gave up still reports, but not that the one which gave up stopped: dropping the return after the block-validity failure kept it running and the ctest passed. Every failure repeats the test name, so a second one means it did not stop. Claude-Session: https://claude.ai/code/session_016UHPAGwcwXMjqhTLpT31K7
chfast
force-pushed
the
tooling/one-subcommand
branch
from
September 1, 2026 21:14
37cbdbe to
a1ba4cc
Compare
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.
CLI11 lets a subcommand's own name appear among another subcommand's
arguments and parses it as a second command. Both then match, and the
dispatch tries
runfirst, so a trailingrunsilently replacedwhatever was asked for:
The t8n was discarded without a word.
require_subcommand(0, 1)makesthe stray name an argument again, which fails to parse and says so.
Two tests cover it, one per direction. Each asserts the error and, more
importantly, that
Result: successdoes not appear, so a regressionwhich runs the wrong command is caught even if the wording changes.
Both fail when the fix is reverted.