-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Implement the --help
command
#5409
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
v-next/hardhat/example.config.ts
Outdated
|
||
const exampleTaskOverride = overrideTask("example") | ||
.setAction(async (args, _hre, runSuper) => { | ||
import type { HardhatUserConfig } from "./src/config.js"; |
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.
Just a note, this config to play around with v3 can now be done in example-project
.
import type { ParameterType } from "@nomicfoundation/hardhat-core/config"; | ||
import type { Task } from "@nomicfoundation/hardhat-core/types/tasks"; | ||
|
||
export const GLOBAL_OPTIONS = [ |
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.
Just a note: I think we can handle this and reserved words differently so that they are more unified with the rest of the global options.
For a follow up pr though
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.
I created an issue for this
.map((letter, idx) => { | ||
return letter.toUpperCase() === letter | ||
? `${idx !== 0 ? "-" : ""}${letter.toLowerCase()}` | ||
: letter; | ||
}) |
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.
@schaable do we have a utility for this?
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.
we have the opposite (kebabToCamel
). We should add this.
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.
Added an issue to track it #5465
let output = `Usage: hardhat [GLOBAL OPTIONS] ${task.id.join(" ")}`; | ||
|
||
if (options.length > 0) { | ||
output += ` ${options.map((o) => `[${o.name}${o.type === "BOOLEAN" ? "" : ` <${o.type}>`}]`).join(" ")}`; |
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.
Options and positional arguments can be optional if they have a default value. In that case, they need to be wrapped around "[]`, otherwise they don't.
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.
As discussed, these options may all be, well... optional
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.
Just left a small comment about [
]
for optional params. The rest looks good to me.
resolves #5348
Global:

Per task:

Per empty task:
