Skip to content

Commit ba62519

Browse files
committed
Rename and move the builtin options
1 parent cd7e3e7 commit ba62519

File tree

3 files changed

+24
-25
lines changed

3 files changed

+24
-25
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
export const BUILTIN_OPTIONS: Array<{
2+
name: string;
3+
description: string;
4+
}> = [
5+
{
6+
name: "--config",
7+
description: "A Hardhat config file.",
8+
},
9+
{
10+
name: "--help",
11+
description: "Shows this message, or a task's help if its name is provided",
12+
},
13+
{
14+
name: "--show-stack-traces",
15+
description: "Show stack traces (always enabled on CI servers).",
16+
},
17+
{
18+
name: "--version",
19+
description: "Shows hardhat's version.",
20+
},
21+
];

v-next/hardhat/src/internal/cli/helpers/getGlobalHelpString.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import type { Task } from "@ignored/hardhat-vnext-core/types/tasks";
22

3+
import { BUILTIN_OPTIONS } from "../../builtin-options.js";
34
import { getHardhatVersion } from "../../utils/package.js";
45

56
import {
67
GLOBAL_NAME_PADDING,
7-
GLOBAL_OPTIONS,
88
getLongestNameLength,
99
getSection,
1010
parseTasks,
@@ -18,7 +18,7 @@ export async function getGlobalHelpString(
1818
const { tasks, subtasks } = parseTasks(rootTasks);
1919

2020
const namePadding =
21-
getLongestNameLength([...tasks, ...subtasks, ...GLOBAL_OPTIONS]) +
21+
getLongestNameLength([...tasks, ...subtasks, ...BUILTIN_OPTIONS]) +
2222
GLOBAL_NAME_PADDING;
2323

2424
let output = `Hardhat version ${version}
@@ -34,7 +34,7 @@ Usage: hardhat [GLOBAL OPTIONS] <TASK> [SUBTASK] [TASK OPTIONS] [--] [TASK ARGUM
3434
output += getSection("AVAILABLE SUBTASKS", subtasks, namePadding);
3535
}
3636

37-
output += getSection("GLOBAL OPTIONS", GLOBAL_OPTIONS, namePadding);
37+
output += getSection("GLOBAL OPTIONS", BUILTIN_OPTIONS, namePadding);
3838

3939
output += `\nTo get help for a specific task run: npx hardhat <TASK> [SUBTASK] --help`;
4040

v-next/hardhat/src/internal/cli/helpers/utils.ts

-22
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,6 @@
11
import type { ParameterType } from "@ignored/hardhat-vnext-core/config";
22
import type { Task } from "@ignored/hardhat-vnext-core/types/tasks";
33

4-
export const GLOBAL_OPTIONS: Array<{
5-
name: string;
6-
description: string;
7-
}> = [
8-
{
9-
name: "--config",
10-
description: "A Hardhat config file.",
11-
},
12-
{
13-
name: "--help",
14-
description: "Shows this message, or a task's help if its name is provided",
15-
},
16-
{
17-
name: "--show-stack-traces",
18-
description: "Show stack traces (always enabled on CI servers).",
19-
},
20-
{
21-
name: "--version",
22-
description: "Shows hardhat's version.",
23-
},
24-
];
25-
264
export const GLOBAL_NAME_PADDING = 6;
275

286
export function parseTasks(taskMap: Map<string, Task>): {

0 commit comments

Comments
 (0)