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

Invalid subcommand doesn't show any errors #259

Closed
ilblackdragon opened this issue Feb 1, 2020 · 3 comments
Closed

Invalid subcommand doesn't show any errors #259

ilblackdragon opened this issue Feb 1, 2020 · 3 comments
Assignees

Comments

@ilblackdragon
Copy link
Member

Currently running non-existent / invalid sub-command doesn't result in any error.

near transfer acc1 my_validator 1
[WARNING] Didn't find config at /Users/cypress/projects/nearprotocol/stakewars/staking-contract/src/config, using default shell config
{ networkId: 'local',
  nodeUrl: 'http://localhost:3030',
  keyPath: '/Users/cypress/.near/validator_key.json',
  walletUrl: 'http://localhost:4000/wallet',
  contractName: 'near-hello-devnet' }
(node:53295) ExperimentalWarning: The fs.promises API is experimental
@vgrichina
Copy link
Contributor

@mikedotexe related PR #51

Note that just re-enabling strict mode is problematic, as then loading config fails when command doesn't support all of the options in config.

It should be possible to solve by loading and merging config with options manually vs going through yargs. Best place to put it is likely yargs middleware:
https://github.com/yargs/yargs/blob/master/docs/advanced.md#middleware

@mikedotexe
Copy link
Contributor

mikedotexe commented Feb 3, 2020

@mikedotexe related PR #51

Note that just re-enabling strict mode is problematic, as then loading config fails when command doesn't support all of the options in config.

It should be possible to solve by loading and merging config with options manually vs going through yargs. Best place to put it is likely yargs middleware:
https://github.com/yargs/yargs/blob/master/docs/advanced.md#middleware

Super helpful context, thank you. I took another approach here
#262
that doesn't use the strict mode, but has a default.
Knowing the history of this issue, I'll tag Jane and you on it since you'll immediately understand

Edit: you replied 2 minutes before this in PR. looking into this more

@mikedotexe
Copy link
Contributor

Finally got this through, thanks for the patience, Illia.

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

No branches or pull requests

3 participants