Skip to content

Commit

Permalink
🐛 show scan+run+shell as regular commands in --help (#1777)
Browse files Browse the repository at this point in the history
  • Loading branch information
arlimus authored Sep 18, 2023
1 parent 5a90a90 commit fc5c872
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions apps/cnquery/cmd/run.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ var RunCmd = &cobra.Command{
PreRun: func(cmd *cobra.Command, args []string) {
viper.BindPFlag("platform-id", cmd.Flags().Lookup("platform-id"))
},
// we have to initialize an empty run so it shows up as a runnable command in --help
Run: func(cmd *cobra.Command, args []string) {},
}

var RunCmdRun = func(cmd *cobra.Command, runtime *providers.Runtime, cliRes *plugin.ParseCLIRes) {
Expand Down
2 changes: 2 additions & 0 deletions apps/cnquery/cmd/scan.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,8 @@ To manually configure a query pack, use this:
}
return []string{}, cobra.ShellCompDirectiveNoFileComp
},
// we have to initialize an empty run so it shows up as a runnable command in --help
Run: func(cmd *cobra.Command, args []string) {},
}

var scanCmdRun = func(cmd *cobra.Command, runtime *providers.Runtime, cliRes *plugin.ParseCLIRes) {
Expand Down
2 changes: 2 additions & 0 deletions apps/cnquery/cmd/shell.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ var shellCmd = &cobra.Command{
PreRun: func(cmd *cobra.Command, args []string) {
viper.BindPFlag("platform-id", cmd.Flags().Lookup("platform-id"))
},
// we have to initialize an empty run so it shows up as a runnable command in --help
Run: func(cmd *cobra.Command, args []string) {},
}

var shellRun = func(cmd *cobra.Command, runtime *providers.Runtime, cliRes *plugin.ParseCLIRes) {
Expand Down

0 comments on commit fc5c872

Please sign in to comment.