You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working in an interactivity plugin, that uses enquirer to collect arguments that were not provided when calling any task.
For example, if one were to call npx hardhat run (notice the <script> argument missing), this would produce the error:
Error HH307: Missing positional argument script
With this plugin, you would instead get:
? Enter script (A js file to be run within hardhat's environment): › ...
This is easily done by traversing all the tasks in the hre and changing isOptional to false, given that in my interactive mode, all arguments are treated equal.
However, the plugin throws when I reach this point, because environment extensions occur right after argument parsing.
I believe that giving us the option to modify task definitions before parsing occurs should be as simple as moving the line that creates the Environment object in packages/hardhat-core/src/internal/cli/cli.ts a few lines up.
The text was updated successfully, but these errors were encountered:
I'm working in an interactivity plugin, that uses enquirer to collect arguments that were not provided when calling any task.
For example, if one were to call
npx hardhat run
(notice the <script> argument missing), this would produce the error:With this plugin, you would instead get:
This is easily done by traversing all the tasks in the hre and changing
isOptional
to false, given that in my interactive mode, all arguments are treated equal.However, the plugin throws when I reach this point, because environment extensions occur right after argument parsing.
I believe that giving us the option to modify task definitions before parsing occurs should be as simple as moving the line that creates the Environment object in
packages/hardhat-core/src/internal/cli/cli.ts
a few lines up.The text was updated successfully, but these errors were encountered: