Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLI: Fix global flag corner case #20776

Merged
merged 4 commits into from
Jan 25, 2023
Merged

CLI: Fix global flag corner case #20776

merged 4 commits into from
Jan 25, 2023

Conversation

shilman
Copy link
Member

@shilman shilman commented Jan 25, 2023

Issue: N/A

What I did

Global CLI flags were not getting properly passed down to their commands per tj/commander.js#1426

In later versions of commander, they added a program.optsWithGlobals() helper, but I don't want to upgrade now. If somebody else wants to, they are welcome to, but preferably after 7.0.

How to test

Replace the init action with console.log({ debug: options.debug }). Then:

yarn build cli
./lib/cli/bin/index.js init --debug

Checklist

FIXME

Maintainers

  • If this PR should be tested against many or all sandboxes,
    make sure to add the ci:merged or ci:daily GH label to it.
  • Make sure this PR contains one of the labels below.

["cleanup", "BREAKING CHANGE", "feature request", "bug", "documentation", "maintenance", "dependencies", "other"]

@shilman shilman changed the title CLI: Fix global flag handling CLI: Fix global flag corner case Jan 25, 2023
@shilman shilman marked this pull request as ready for review January 25, 2023 15:51
@shilman
Copy link
Member Author

shilman commented Jan 25, 2023

Self-merging @tmeasday

@shilman shilman merged commit 1dc6152 into next Jan 25, 2023
@shilman shilman deleted the shilman/fix-cli-options branch January 25, 2023 17:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant