File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed
Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -28,6 +28,7 @@ var Version = "DEV"
2828var BuildDate = "" // YYYY-MM-DD
2929
3030var versionOutput = ""
31+ var cobraDefaultHelpFunc func (* cobra.Command , []string )
3132
3233func init () {
3334 if Version == "DEV" {
@@ -51,6 +52,7 @@ func init() {
5152 // TODO:
5253 // RootCmd.PersistentFlags().BoolP("verbose", "V", false, "enable verbose output")
5354
55+ cobraDefaultHelpFunc = RootCmd .HelpFunc ()
5456 RootCmd .SetHelpFunc (rootHelpFunc )
5557
5658 RootCmd .SetFlagErrorFunc (func (cmd * cobra.Command , err error ) error {
@@ -249,6 +251,11 @@ func determineBaseRepo(cmd *cobra.Command, ctx context.Context) (ghrepo.Interfac
249251}
250252
251253func rootHelpFunc (command * cobra.Command , s []string ) {
254+ if command != RootCmd {
255+ cobraDefaultHelpFunc (command , s )
256+ return
257+ }
258+
252259 type helpEntry struct {
253260 Title string
254261 Body string
You can’t perform that action at this time.
0 commit comments