File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -231,13 +231,16 @@ export async function runCLI(entrypoint: string) {
231231 return errorMessageSplit [ 1 ] ;
232232 } ) ( ) ;
233233
234- const closestMatches = useCommandSuggestions ( `${ parsed . _ [ 0 ] } ${ errorMessageSplit [ 1 ] } ` ) ;
234+ const closestMatches =
235+ nonexistentType === 'subcommand'
236+ ? useCommandSuggestions ( `${ parsed . _ [ 0 ] } ${ errorMessageSplit [ 1 ] } ` )
237+ : [ ] ;
235238
236239 const messageParts = [
237240 chalk . gray ( `Nonexistent ${ nonexistentType } : ${ chalk . whiteBright ( nonexistentRepresentation ) } ` ) ,
238241 ] ;
239242
240- if ( closestMatches . length && nonexistentType === 'subcommand' ) {
243+ if ( closestMatches . length ) {
241244 messageParts . push (
242245 chalk . gray (
243246 ` Did you mean: ${ closestMatches . map ( ( cmd ) => chalk . whiteBright ( cmd ) ) . join ( ', ' ) } ?` ,
You can’t perform that action at this time.
0 commit comments