Skip to content

Commit 6043612

Browse files
Merge branch 'main' into erikarowland/source-alias-subcommand-aliases-from-subcommand-structs
2 parents 91ef09a + 6dad6ab commit 6043612

File tree

3 files changed

+8
-22
lines changed

3 files changed

+8
-22
lines changed

.changeset/fast-walls-enjoy.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'vercel': patch
3+
---
4+
5+
Don't print empty "Examples" section in `--help` output

packages/cli/src/commands/help.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,9 @@ export function buildSubcommandLines(
270270
}
271271

272272
export function buildCommandExampleLines(command: Command) {
273+
if (!command.examples?.length) {
274+
return null;
275+
}
273276
const outputArray: string[] = [`${INDENT}${chalk.dim('Examples:')}`, ''];
274277
for (const example of command.examples) {
275278
const nameLine: string[] = [INDENT];

packages/cli/test/unit/commands/__snapshots__/help.test.ts.snap

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ exports[`help command > alias help output snapshots > alias list subcommand > al
189189
-v, --version Output the version number
190190

191191

192-
Examples:
193-
194192
"
195193
`;
196194

@@ -218,8 +216,6 @@ exports[`help command > alias help output snapshots > alias remove subcommand >
218216
-v, --version Output the version number
219217

220218

221-
Examples:
222-
223219
"
224220
`;
225221

@@ -242,8 +238,6 @@ exports[`help command > alias help output snapshots > alias set subcommand > ali
242238
-v, --version Output the version number
243239

244240

245-
Examples:
246-
247241
"
248242
`;
249243

@@ -440,8 +434,6 @@ exports[`help command > certs help output snapshots > certs add help output snap
440434
-v, --version Output the version number
441435

442436

443-
Examples:
444-
445437
"
446438
`;
447439

@@ -1109,8 +1101,6 @@ exports[`help command > dns help output snapshots > dns add help output snapshot
11091101
-v, --version Output the version number
11101102

11111103

1112-
Examples:
1113-
11141104
"
11151105
`;
11161106

@@ -1371,8 +1361,6 @@ exports[`help command > dns help output snapshots > dns import help output snaps
13711361
-v, --version Output the version number
13721362

13731363

1374-
Examples:
1375-
13761364
"
13771365
`;
13781366

@@ -1401,8 +1389,6 @@ exports[`help command > dns help output snapshots > dns list help output snapsho
14011389
-v, --version Output the version number
14021390

14031391

1404-
Examples:
1405-
14061392
"
14071393
`;
14081394

@@ -1425,8 +1411,6 @@ exports[`help command > dns help output snapshots > dns remove help output snaps
14251411
-v, --version Output the version number
14261412

14271413

1428-
Examples:
1429-
14301414
"
14311415
`;
14321416

@@ -2590,8 +2574,6 @@ exports[`help command > integration help output snapshots > integration help col
25902574
number
25912575

25922576

2593-
Examples:
2594-
25952577
"
25962578
`;
25972579

@@ -2623,8 +2605,6 @@ exports[`help command > integration help output snapshots > integration help col
26232605
-v, --version Output the version number
26242606

26252607

2626-
Examples:
2627-
26282608
"
26292609
`;
26302610

@@ -2655,8 +2635,6 @@ exports[`help command > integration help output snapshots > integration help col
26552635
-v, --version Output the version number
26562636

26572637

2658-
Examples:
2659-
26602638
"
26612639
`;
26622640

0 commit comments

Comments
 (0)