Skip to content

feat(cli): get remaining flags now returns empty when no flag is found#3468

Open
QusaiAlbonni wants to merge 1 commit into
nestjs:v12.0.0from
QusaiAlbonni:fix/get-remaining-flags-skip-non-flag-args
Open

feat(cli): get remaining flags now returns empty when no flag is found#3468
QusaiAlbonni wants to merge 1 commit into
nestjs:v12.0.0from
QusaiAlbonni:fix/get-remaining-flags-skip-non-flag-args

Conversation

@QusaiAlbonni

Copy link
Copy Markdown

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Feature

What is the current behavior?

Issue Number: #3466

What is the new behavior?

getRemainingFlags now returns an empty array when no flags are found instead of returning all arguments.

In v11/master this behavior contributes to a downstream failure and is therefore treated as a bug fix. However, in the v12 branch, #3355 modified camelCase to handle these values safely, so the incorrect return value and processing of it no longer causes a user-visible failure. As a result, this change is classified as an enhancement/semantic correction rather than a bug fix as it might prevent future bugs from emerging.

Does this PR introduce a breaking change?

  • No

Other information

@QusaiAlbonni QusaiAlbonni marked this pull request as draft June 13, 2026 13:16
@QusaiAlbonni QusaiAlbonni marked this pull request as ready for review June 13, 2026 13:22
@kamilmysliwiec

Copy link
Copy Markdown
Member

could you add an e2e test?

@QusaiAlbonni

Copy link
Copy Markdown
Author

could you add an e2e test?

just to be clear an e2e test for the case of -no- in argv[0] just like the original issue? if so yes I can.

@kamilmysliwiec

Copy link
Copy Markdown
Member

an e2e test which confirms that if you run a command with a path containing -no- it doesnt fail

@QusaiAlbonni QusaiAlbonni force-pushed the fix/get-remaining-flags-skip-non-flag-args branch 2 times, most recently from ceadc01 to c1b0664 Compare June 15, 2026 13:04
@QusaiAlbonni QusaiAlbonni force-pushed the fix/get-remaining-flags-skip-non-flag-args branch from c1b0664 to 3ed7aee Compare June 15, 2026 13:09
@QusaiAlbonni QusaiAlbonni marked this pull request as draft June 15, 2026 13:18
@QusaiAlbonni

QusaiAlbonni commented Jun 15, 2026

Copy link
Copy Markdown
Author

an e2e test which confirms that if you run a command with a path containing -no- it doesnt fail

localBinaries is importing commands from the project local node_modules which is why the e2e test is failing in circleci as the fix was not applied yet to the current release in v11

@QusaiAlbonni QusaiAlbonni marked this pull request as ready for review June 15, 2026 13:51
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