Skip to content

Commit

Permalink
🐛 show scan+run+shell as regular commands in --help
Browse files Browse the repository at this point in the history
Signed-off-by: Dominik Richter <[email protected]>
  • Loading branch information
arlimus committed Sep 18, 2023
1 parent 5a90a90 commit 01f4c79
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 01f4c79

Please sign in to comment.