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: suppress help on CLI failures #4976

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

fix: suppress help on CLI failures #4976

wants to merge 2 commits into from

Conversation

yorhodes
Copy link
Member

@yorhodes yorhodes commented Dec 9, 2024

Description

Drive-by changes

Related issues

Backward compatibility

Testing

@yorhodes yorhodes requested review from jmrossy and ltyu as code owners December 9, 2024 20:15
Copy link

changeset-bot bot commented Dec 9, 2024

🦋 Changeset detected

Latest commit: 5fa074d

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 9 packages
Name Type
@hyperlane-xyz/cli Patch
@hyperlane-xyz/ccip-server Patch
@hyperlane-xyz/github-proxy Patch
@hyperlane-xyz/helloworld Patch
@hyperlane-xyz/infra Patch
@hyperlane-xyz/sdk Patch
@hyperlane-xyz/utils Patch
@hyperlane-xyz/widgets Patch
@hyperlane-xyz/core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@yorhodes yorhodes changed the title Suppress help on CLI failures fix: suppress help on CLI failures Dec 9, 2024
console.log('');
yargs.showHelp();
console.log('');
if (err) errorRed(err.toString());
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we definitely want to cut this line? Can a command fail without throwing an error?

Copy link
Member Author

@yorhodes yorhodes Dec 9, 2024

Choose a reason for hiding this comment

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

https://yargs.js.org/docs/#api-reference-failfn-boolean
https://yargs.js.org/docs/#api-reference-showhelponfailenable-message
customizing the fail handler seems unnecessary and the existing branching in here doesnt really make sense to me

Copy link
Member Author

Choose a reason for hiding this comment

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

atm the help string is logged whether or not the error is related to a missing argument

Copy link

codecov bot commented Dec 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 77.53%. Comparing base (64cce47) to head (5fa074d).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4976   +/-   ##
=======================================
  Coverage   77.53%   77.53%           
=======================================
  Files         103      103           
  Lines        2110     2110           
  Branches      190      190           
=======================================
  Hits         1636     1636           
  Misses        453      453           
  Partials       21       21           
Components Coverage Δ
core 87.80% <ø> (ø)
hooks 79.39% <ø> (ø)
isms 83.68% <ø> (ø)
token 91.27% <ø> (ø)
middlewares 79.80% <ø> (ø)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

2 participants