This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
add yarg’s strict() to chain. add walletUrl, contractName as options #265
add yarg’s strict() to chain. add walletUrl, contractName as options #265
Changes from 8 commits
219aa28
6d4dece
efc12ac
7d35f56
3189a4e
ae31dc2
6e2d01f
bd58809
dcf0d8a
bc7a73f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why hide all of these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good debate to be had. The short answer is, there's a long road to getting
near-shell
consistent, and this is something of a bandaid. Actually, this whole PR is a bandaid.Note that when you run:
near
to display the default help from yargs, it spits out commands and then theOptions:
section. These are flags that typically (again, we're working on it) apply to the top-level commands. Actually, the only good example of this is--accountId
here.Then, when you run
near create_account --help
you'll see the relevantOptions:
for that particular command, including--masterAccount
.This
hidden
key is not hiding it everywhere, but hiding it from the top-level list. I'm not against removing thehidden
part, but it'll just make thThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
whoops. It'll just make that a bit longer. The fundamental issue here is we want to use
strict
mode, but we can't do that when we loadconfig.js
and it contains additional flags that aren't captured at the top level. So in this PR we're like, "yeah, you can give me amasterAccount
flag here, it won't do much on its own, but you can"And from there
yargs
'sstrict
mode is possible whereby it'll scream at you if you misspell something or provide suggestions (recommendCommands
) or tell you what you're missing.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Excellent explanation, thank you