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(cli): warn on unknown commands #1304

Merged
merged 3 commits into from Nov 27, 2019
Merged

Conversation

malept
Copy link
Member

@malept malept commented Nov 27, 2019

  • I have read the contribution documentation for this project.
  • I agree to follow the code of conduct that this project follows, as appropriate.
  • The changes have sufficient test coverage (if applicable).
  • The testsuite passes successfully on my local machine (if applicable).

Summarize your changes:

Emit a warning and exit with status code 1.

Based on tj/commander.js#1088 (comment)

Example:

$ electron-forge foobar foo
✔ Checking your system

Unknown command "foobar foo".
See --help for a list of available commands.

Fixes #1300
Closes #1301 (This is a simpler version, with an integration test added.)

@codecov
Copy link

codecov bot commented Nov 27, 2019

Codecov Report

Merging #1304 into master will decrease coverage by 1.15%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1304      +/-   ##
==========================================
- Coverage   68.43%   67.28%   -1.16%     
==========================================
  Files          67       69       +2     
  Lines        1958     2002      +44     
  Branches      378      383       +5     
==========================================
+ Hits         1340     1347       +7     
- Misses        444      479      +35     
- Partials      174      176       +2
Impacted Files Coverage Δ
packages/api/cli/src/electron-forge.ts 55.17% <100%> (ø)
packages/maker/flatpak/src/MakerFlatpak.ts 72.72% <0%> (-9.1%) ⬇️
packages/maker/zip/src/MakerZIP.ts 90.9% <0%> (-9.1%) ⬇️
packages/api/core/src/util/electron-version.ts 88.23% <0%> (-7.85%) ⬇️
packages/api/core/src/api/make.ts 64.77% <0%> (-5.69%) ⬇️
packages/maker/dmg/src/MakerDMG.ts 94.44% <0%> (-5.56%) ⬇️
packages/utils/async-ora/src/ora.ts 56.66% <0%> (-3.34%) ⬇️
packages/maker/base/src/Maker.ts 64.51% <0%> (-3.23%) ⬇️
packages/api/cli/src/util/terminate.ts 20% <0%> (ø)
... and 1 more

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 92817f4...e2aabd2. Read the comment docs.

@malept malept merged commit a0c15d9 into master Nov 27, 2019
@malept malept deleted the handle-unknown-subcommands branch November 27, 2019 18:47
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.

Warn the user on supplying unknown commands
1 participant