NomicFoundation / hardhat

Hardhat is a development environment to compile, deploy, test, and debug your Ethereum software.
https://hardhat.org
Other
7.24k stars 1.39k forks source link

Add support for end of options token (`--`) in Hardhat tasks #4314

Open fvictorio opened 1 year ago

fvictorio commented 1 year ago

The main driver for this is https://github.com/NomicFoundation/hardhat/issues/4307

This needs some definition, but the idea is that you could do something like:

task("foo").addVerbatimOptions(...) // DSL verb to be defined

and if you run hh foo --some-flag --some-param 2 pos1 pos2 -- other params --even --like -t -h -i -s then the things after -- are passed as a raw array of strings to the task.

jmendiola222 commented 1 year ago

Suggestion, can't this just be the default behavior of any unrecognized param? To "pass it as a raw array of strings to the task" I mean. Any "Error HH305: Unrecognized param" can become a warning and the param just cascades down to the following "parser" in the pipeline.