-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhiding-command-group.ts
54 lines (45 loc) · 1.81 KB
/
hiding-command-group.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { c } from '@carnesen/cli';
import { echoCommand } from './echo-command';
import { echoHiddenCommand } from './echo-hidden-command';
import { echoPizzaCommand } from './echo-pizza-command';
export const hiddenCommandGroup = c.commandGroup({
name: 'hidden-command-group',
description: `
This is a command group that has hidden=true. It does not show up
in the list of "subcommands", but it is otherwise fully functional.`,
hidden: true,
subcommands: [echoCommand],
});
export const nonHiddenCommandGroup = c.commandGroup({
name: 'normal-command-group',
description: `
This is a normal non-hidden command group that shows up in
command-line usage documentation like you'd expect`,
subcommands: [echoCommand],
});
export const hidingCommandGroup = c.commandGroup({
name: 'hiding',
description: `
This command group demonstrates the use of the "hidden" flag for commands,
command groups, and argument groups.
This command group has a hidden subcommand "${echoHiddenCommand.name}".
Hidden commands are just like non-hidden ones except they don't show up in
auto-generated command-line usage documentation unless the user invokes
that subcommand specifically as e.g. (try it!):
${echoHiddenCommand.name} --help
This command group has a hidden command group underneath it named
"${hiddenCommandGroup.name}". Hidden command groups are just like
normal command groups except they don't show up in auto-generated
command-line usage documentation unless the user navigates to them
specifically as e.g. (try it!):
${hiddenCommandGroup.name} --help
Notice that neither "${echoHiddenCommand.name}" nor "${hiddenCommandGroup.name}"
appear in the auto-generated subcommand list.
`,
subcommands: [
echoHiddenCommand,
echoPizzaCommand,
hiddenCommandGroup,
nonHiddenCommandGroup,
],
});