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]: show help when invalid flag is supplied #1051

Merged
merged 2 commits into from
Feb 10, 2020
Merged

Conversation

anshumanv
Copy link
Member

Fixes #1046

What kind of change does this PR introduce?
intercept flag parsing and if any invalid flag is present, print a neat err.

Did you add tests for your changes?
Will add

If relevant, did you update the documentation?
NA

Summary

  • Output pretty message when invalid flag is supplied.

Does this PR introduce a breaking change?
No

Other information

@anshumanv anshumanv requested a review from a team as a code owner August 19, 2019 15:30
lib/bootstrap.js Outdated Show resolved Hide resolved
lib/bootstrap.js Outdated Show resolved Hide resolved
@anshumanv
Copy link
Member Author

Looks like this atm -

image

@anshumanv
Copy link
Member Author

debugging

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we need to chill this until a fix for #1050 (fixing dupe args) is landed, because it will most likely impact this PR.

@anshumanv
Copy link
Member Author

Sounds good even!

Copy link
Member

@evenstensberg evenstensberg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay this could be resumed now, UNKNOWN_VALUE L41 in bootstrap needs modification

@anshumanv
Copy link
Member Author

Will get back on this in a bit. 👍

@anshumanv
Copy link
Member Author

We already have an unknown flag log when the flag is supplied, are there any other requirements/enhancements that we can do to it? @evenstensberg @ematipico

@ematipico
Copy link
Contributor

Hi @anshumanv sorry to coming back to you so late, I completely missed this PR!

About the message provided, could you print webpack --help instead? If you rebased your PR, I would be happy to review it and merge it!

@anshumanv
Copy link
Member Author

Hey Emanuale,

About the message provided, could you print webpack --help instead

Def sounds better to be, will rebase and change it in a while 👍

handle invalid flags and show help in case invalid flag is supplied

ISSUES CLOSED: webpack#1046
cleanup custom logic to determine invalid flags

ISSUES CLOSED: webpack#1046
@anshumanv anshumanv changed the title [cli]: pretty err when invalid flag is supplied [cli]: show help when invalid flag is supplied Feb 6, 2020
@webpack-bot
Copy link

Thank you for your pull request! The most important CI builds succeeded, we’ll review the pull request soon.

@ematipico
Copy link
Contributor

Thank you!

@ematipico ematipico merged commit 6663e94 into webpack:next Feb 10, 2020
@anshumanv anshumanv deleted the 1046 branch February 10, 2020 15:13
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.

[ENHANCEMENT]: Prettify err in case the supplied flag(s) is/are unknown
5 participants