If you try to run this in the new v-next/example-package you'll get an error
pnpm hardhat hello --greeting asd
/workspaces/hardhat/v-next/hardhat/src/internal/cli/main.ts:382
throw new HardhatError(
^
HardhatError: HHE304: Invalid parameter --greeting. It is neither a valid global parameter nor associated with any task. Did you forget to add the task first, or did you misspell it?
at parseDoubleDashArgs (/workspaces/hardhat/v-next/hardhat/src/internal/cli/main.ts:382:13)
at parseGlobalArguments (/workspaces/hardhat/v-next/hardhat/src/internal/cli/main.ts:222:3)
at main (/workspaces/hardhat/v-next/hardhat/src/internal/cli/main.ts:70:41) {
[cause]: undefined
}
Node.js v22.2.0
I think this was probably introduced with the refactor to the task parsing logic.
Version of Hardhat
v-next
What happened?
If you try to run this in the new
v-next/example-package
you'll get an errorI think this was probably introduced with the refactor to the task parsing logic.
We should add a regression test and fix it.
Minimal reproduction steps
Described above.
Search terms
No response