Skip to content

fix(W-19992616): warn about unparsed arguments#1490

Merged
cristiand391 merged 1 commit intomainfrom
mdonnalley/warn-about-parse
Oct 23, 2025
Merged

fix(W-19992616): warn about unparsed arguments#1490
cristiand391 merged 1 commit intomainfrom
mdonnalley/warn-about-parse

Conversation

@mdonnalley
Copy link
Contributor

@mdonnalley mdonnalley commented Oct 20, 2025

Emit a process warning in development when a command does not call this.parse - this should help developers avoid potential design errors while still providing flexibility to call this.parse wherever it makes most sense for them

Testing

Generate oclif cli: oclif generate my-cli --yes
cd into it: cd my-cli
Link oclif/core into the cli: yarn link @oclif/core
Run: bin/dev.js hello world

You should see the new warning when running the command.

Then modify src/commands/hello/world.ts to call this.parse(HelloWorld) inside the run method. You should not see the warning when running the command

Fixes #1375
@W-19992616@

@mdonnalley mdonnalley force-pushed the mdonnalley/warn-about-parse branch 2 times, most recently from 4c59f50 to 4ac69fb Compare October 20, 2025 18:53
@mdonnalley mdonnalley force-pushed the mdonnalley/warn-about-parse branch from 4ac69fb to a8a852d Compare October 21, 2025 15:42
@cristiand391 cristiand391 merged commit 5ad6bf0 into main Oct 23, 2025
85 checks passed
@cristiand391 cristiand391 deleted the mdonnalley/warn-about-parse branch October 23, 2025 13:11
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.

Design footgun. If you don't call parse() the CLI silently ignores all flags

2 participants