@@ -148,6 +148,55 @@ describe('formatCommand', () => {
148148 expect ( result ) . toContain ( 'Verbosity level' )
149149 } )
150150
151+ test ( 'omits value placeholders for boolean flag options' , ( ) => {
152+ const result = Help . formatCommand ( 'tool deploy' , {
153+ options : z . object ( {
154+ dryRun : z . boolean ( ) . optional ( ) . describe ( 'Preview without submitting.' ) ,
155+ } ) ,
156+ } )
157+
158+ const line = result . split ( '\n' ) . find ( ( line ) => line . includes ( '--dry-run' ) )
159+
160+ expect ( line ) . toBe ( ' --dry-run Preview without submitting.' )
161+ } )
162+
163+ test ( 'omits value placeholders for aliased boolean flag options' , ( ) => {
164+ const result = Help . formatCommand ( 'tool deploy' , {
165+ options : z . object ( {
166+ dryRun : z . boolean ( ) . optional ( ) . describe ( 'Preview without submitting.' ) ,
167+ } ) ,
168+ alias : { dryRun : 'd' } ,
169+ } )
170+
171+ const line = result . split ( '\n' ) . find ( ( line ) => line . includes ( '--dry-run' ) )
172+
173+ expect ( line ) . toBe ( ' --dry-run, -d Preview without submitting.' )
174+ } )
175+
176+ test ( 'omits default false for boolean flag options' , ( ) => {
177+ const result = Help . formatCommand ( 'tool deploy' , {
178+ options : z . object ( {
179+ dryRun : z . boolean ( ) . default ( false ) . describe ( 'Preview without submitting.' ) ,
180+ } ) ,
181+ } )
182+
183+ const line = result . split ( '\n' ) . find ( ( line ) => line . includes ( '--dry-run' ) )
184+
185+ expect ( line ) . toBe ( ' --dry-run Preview without submitting.' )
186+ } )
187+
188+ test ( 'shows default true for boolean flag options' , ( ) => {
189+ const result = Help . formatCommand ( 'tool deploy' , {
190+ options : z . object ( {
191+ watch : z . boolean ( ) . default ( true ) . describe ( 'Watch for changes.' ) ,
192+ } ) ,
193+ } )
194+
195+ const line = result . split ( '\n' ) . find ( ( line ) => line . includes ( '--watch' ) )
196+
197+ expect ( line ) . toBe ( ' --watch Watch for changes. (default: true)' )
198+ } )
199+
151200 test ( 'shows enum values for z.enum options' , ( ) => {
152201 const result = Help . formatCommand ( 'tool deploy' , {
153202 options : z . object ( {
0 commit comments