Commit ca0af19 1 parent 095b4b4 commit ca0af19 Copy full SHA for ca0af19
File tree 1 file changed +4
-2
lines changed
1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -100,7 +100,8 @@ export default class CommandHelp {
100
100
const body = renderList ( args . map ( a => {
101
101
const name = a . name . toUpperCase ( )
102
102
let description = a . description || ''
103
- if ( a . default ) description = `[default: ${ a . default } ] ${ description } `
103
+ // `a.default` is actually not always a string (typing bug), hence `toString()`
104
+ if ( a . default || a . default ?. toString ( ) === '0' ) description = `[default: ${ a . default } ] ${ description } `
104
105
if ( a . options ) description = `(${ a . options . join ( '|' ) } ) ${ description } `
105
106
return [ name , description ? dim ( description ) : undefined ]
106
107
} ) , { stripAnsi : this . opts . stripAnsi , maxWidth : this . opts . maxWidth - 2 } )
@@ -144,7 +145,8 @@ export default class CommandHelp {
144
145
}
145
146
146
147
let right = flag . description || ''
147
- if ( flag . type === 'option' && flag . default ) {
148
+ // `flag.default` is not always a string (typing bug), hence `toString()`
149
+ if ( flag . type === 'option' && ( flag . default || flag . default ?. toString ( ) === '0' ) ) {
148
150
right = `[default: ${ flag . default } ] ${ right } `
149
151
}
150
152
if ( flag . required ) right = `(required) ${ right } `
You can’t perform that action at this time.
0 commit comments