Repository navigation
Conversation
Why:
Argument normalization discarded unknown command names when help was
requested, so misspelled commands printed root help and exited with 0.
Representation modified (Cli.normalize_argv routing):
Before (text):
rescript invalid --help -> rescript --help=plain
After (text):
rescript invalid --help -> rescript help invalid
Diagnostic modified (unknown command help):
Before (text):
rescript invalid --help
Root help on stdout; exit status 0.
After (text):
rescript invalid --help
rescript: unknown command "invalid"
Exit status 2.
Signed-off-by: Pedro Castro <aspeddro@gmail.com>
Changelog🐛 Bug fix
Semantic Diff2 commits · Full page Reject unknown CLI commands when help is requested413e8bd · aspeddro · Nov 07, 2026, 17:50 UTC
Representation modified (Cli.normalize_argv routing)
-rescript invalid --help -> rescript --help=plain
+rescript invalid --help -> rescript help invalidDiagnostic modified (unknown command help)
rescript invalid --help
-Root help on stdout; exit status 0.
+rescript: unknown command "invalid"
+Exit status 2.✨ Reject unknown CLI commands when version is requested6be17f5 · aspeddro · Nov 07, 2026, 18:09 UTC · new
Representation modified (Cli.normalize_argv routing)
-rescript unkdnow --version -> rescript --version
+rescript unkdnow --version -> rescript help unkdnowDiagnostic modified (unknown command version)
rescript unkdnow --version
-rescript 13.0.0-alpha.8
-Exit status 0.
+rescript: unknown command "unkdnow"
+Exit status 2. |
rescript
@rescript/belt
@rescript/darwin-arm64
@rescript/linux-arm64
@rescript/linux-x64
@rescript/runtime
@rescript/win32-x64
commit: |
Why:
The help fix still let version requests discard unknown subcommands
and exit successfully. Validate command topics for both display flags.
Representation modified (Cli.normalize_argv routing):
Before (text):
rescript unkdnow --version -> rescript --version
After (text):
rescript unkdnow --version -> rescript help unkdnow
Diagnostic modified (unknown command version):
Before (text):
rescript unkdnow --version
rescript 13.0.0-alpha.8
Exit status 0.
After (text):
rescript unkdnow --version
rescript: unknown command "unkdnow"
Exit status 2.
Signed-off-by: Pedro Castro <aspeddro@gmail.com>
This branch has not been deployed
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.
rescript invalid --helpandrescript unkdnow --versionpreviously discarded the unknown command, printed help or version, and exited with code 0. Validate positional command names before either display request so unknown commands report an error and exit with code 2.Includes regression coverage for long, short, leading, formatted, and clustered help/version flags, plus a changelog fragment.
Validation: toolchain build, 55 unit tests, 103 command-validation cases, OCaml formatting, changelog validation, and manual checks through the Node CLI launcher.
Checklist