@@ -23,7 +23,7 @@ describe('Command help', () => {
23
23
'' ,
24
24
'Options:' ,
25
25
'' ,
26
- ' \u001b[33m-h\u001b[39m, \u001b[33m--help\u001b[39m Output usage information' ,
26
+ ' \u001b[33m-h\u001b[39m, \u001b[33m--help\u001b[39m Output usage information' ,
27
27
'' ,
28
28
''
29
29
] . join ( '\n' ) ) ;
@@ -42,8 +42,8 @@ describe('Command help', () => {
42
42
'' ,
43
43
'Options:' ,
44
44
'' ,
45
- ' \u001b[33m--foo\u001b[39m Foo' ,
46
- ' \u001b[33m--help\u001b[39m Output usage information' ,
45
+ ' \u001b[33m--foo\u001b[39m Foo' ,
46
+ ' \u001b[33m--help\u001b[39m Output usage information' ,
47
47
'' ,
48
48
''
49
49
] . join ( '\n' ) ) ;
@@ -54,9 +54,12 @@ describe('Command help', () => {
54
54
. command ( 'test' , '[qux]' )
55
55
. description ( 'Test description' )
56
56
. option ( '-f, --foo' , 'Foo' )
57
- . option ( '--bar <baz>' , 'Bar' )
57
+ . option ( '--bar <baz>' , 'Bar' , 8080 )
58
58
. command ( 'nested' )
59
59
. end ( )
60
+ . command ( 'nested2' )
61
+ . description ( 'with description' )
62
+ . end ( )
60
63
. run ( [ '--help' ] ) ;
61
64
62
65
assert . equal ( inspect . output , [
@@ -68,13 +71,14 @@ describe('Command help', () => {
68
71
'' ,
69
72
'Commands:' ,
70
73
'' ,
71
- ' \u001b[32mnested\u001b[39m ' ,
74
+ ' \u001b[32mnested\u001b[39m ' ,
75
+ ' \u001b[32mnested2\u001b[39m with description' ,
72
76
'' ,
73
77
'Options:' ,
74
78
'' ,
75
- ' \u001b[33m--bar\u001b[39m <baz> Bar' ,
76
- ' \u001b[33m-f\u001b[39m, \u001b[33m--foo\u001b[39m Foo' ,
77
- ' \u001b[33m-h\u001b[39m, \u001b[33m--help\u001b[39m Output usage information' ,
79
+ ' \u001b[33m--bar\u001b[39m <baz> Bar' ,
80
+ ' \u001b[33m-f\u001b[39m, \u001b[33m--foo\u001b[39m Foo' ,
81
+ ' \u001b[33m-h\u001b[39m, \u001b[33m--help\u001b[39m Output usage information' ,
78
82
'' ,
79
83
''
80
84
] . join ( '\n' ) ) ;
@@ -96,8 +100,8 @@ describe('Command help', () => {
96
100
'' ,
97
101
'Options:' ,
98
102
'' ,
99
- ' \u001b[33m--bar\u001b[39m <baz> Bar' ,
100
- ' \u001b[33m-h\u001b[39m, \u001b[33m--help\u001b[39m Output usage information' ,
103
+ ' \u001b[33m--bar\u001b[39m <baz> Bar' ,
104
+ ' \u001b[33m-h\u001b[39m, \u001b[33m--help\u001b[39m Output usage information' ,
101
105
'' ,
102
106
''
103
107
] . join ( '\n' ) ) ;
@@ -117,8 +121,8 @@ describe('Command help', () => {
117
121
'' ,
118
122
'Options:' ,
119
123
'' ,
120
- ' \u001b[33m-f\u001b[39m, \u001b[33m--foo\u001b[39m Foo' ,
121
- ' \u001b[33m-h\u001b[39m, \u001b[33m--help\u001b[39m Output usage information' ,
124
+ ' \u001b[33m-f\u001b[39m, \u001b[33m--foo\u001b[39m Foo' ,
125
+ ' \u001b[33m-h\u001b[39m, \u001b[33m--help\u001b[39m Output usage information' ,
122
126
'' ,
123
127
''
124
128
] . join ( '\n' ) ) ;
0 commit comments