Skip to content

Commit 5cd7be7

Browse files
authored
fix(shell): crash on help flag (#3187)
1 parent baff3b8 commit 5cd7be7

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

internal/core/shell.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,12 @@ func shellExecutor(rootCmd *cobra.Command, printer *Printer, meta *meta) func(s
271271
return
272272
}
273273

274+
// command is nil if it does not have a Run function
275+
// ex: instance -h
276+
if meta.command == nil {
277+
return
278+
}
279+
274280
autoCompleteCache.Update(meta.command.Namespace)
275281

276282
printErr := printer.Print(meta.result, meta.command.getHumanMarshalerOpt())

0 commit comments

Comments
 (0)