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

fix #271 - give feedback for unrecognized commands #308

Merged

Conversation

dephiros
Copy link
Contributor

@dephiros dephiros commented Aug 31, 2018

fix #271

@dephiros dephiros changed the title [WIP] - fix #217 - give feedback for unrecognized commands [WIP] - fix #271 - give feedback for unrecognized commands Aug 31, 2018
@dephiros dephiros force-pushed the fix/271-error-for-unknown-command branch from d524c33 to 78b7755 Compare September 1, 2018 14:40
@codecov
Copy link

codecov bot commented Sep 1, 2018

Codecov Report

Merging #308 into master will increase coverage by 0.15%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #308      +/-   ##
==========================================
+ Coverage   91.66%   91.82%   +0.15%     
==========================================
  Files          42       42              
  Lines        1104     1113       +9     
==========================================
+ Hits         1012     1022      +10     
+ Misses         92       91       -1
Impacted Files Coverage Δ
packages/cli/src/api/utils.js 100% <100%> (+6.25%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1832213...5eadede. Read the comment docs.

@dephiros dephiros force-pushed the fix/271-error-for-unknown-command branch from 78b7755 to f2153d7 Compare September 1, 2018 15:09
@dephiros dephiros force-pushed the fix/271-error-for-unknown-command branch from f2153d7 to 3fb55f1 Compare September 4, 2018 15:01
@dephiros
Copy link
Contributor Author

dephiros commented Sep 4, 2018

Realized that I forgot to push up the test file. Will push it up tonight

@tricoder42
Copy link
Contributor

@dephiros Yeah, don't worry about it. I honestly don't know why the test fails, but I rerun the test suit and everything is fine.

I'm gonna merge it in the morning. Great job, thank you very much! ⚡️ ⚡️ ⚡️

Copy link
Contributor

@tricoder42 tricoder42 left a comment

Choose a reason for hiding this comment

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

Alright, I made few changes, but otherwise this PR is good. Thank you for working on this! Really helpful.

  • I moved all console.log inside utility function, because the output strings use chalk anyway, so it's used only in console anyway.
  • Only one command is passed to utility function. I believe it's enough to show the user there's something wrong.
  • finally, I renamed the function to helpMisspelledCommand because it basically shows a help to user. Similar to help from commander.

@tricoder42 tricoder42 changed the title [WIP] - fix #271 - give feedback for unrecognized commands fix #271 - give feedback for unrecognized commands Sep 6, 2018
@tricoder42 tricoder42 merged commit a7204d4 into lingui:master Sep 6, 2018
@dephiros dephiros deleted the fix/271-error-for-unknown-command branch September 6, 2018 14:41
Photonios pushed a commit to SectorLabs/js-lingui that referenced this pull request Dec 9, 2019
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.

CLI is silent when passed an unrecognized option
3 participants