MCPcopy Create free account
hub / github.com/cloudquery/cloudquery / newCmdPluginDocsDownload

Function newCmdPluginDocsDownload

cli/cmd/plugin_docs_download.go:32–57  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

30)
31
32func newCmdPluginDocsDownload() *cobra.Command {
33 cmd := &cobra.Command{
34 Use: "download [-D docs] <team_name>/<plugin_kind>/<plugin_name>@<version>",
35 Short: pluginDocsDownloadShort,
36 Long: pluginDocsDownloadLong,
37 Example: pluginDocsDownloadExample,
38 Args: cobra.ExactArgs(1),
39 RunE: func(cmd *cobra.Command, args []string) error {
40 // Set up a channel to listen for OS signals for graceful shutdown.
41 ctx, cancel := context.WithCancel(cmd.Context())
42
43 sigChan := make(chan os.Signal, 1)
44 signal.Notify(sigChan, syscall.SIGTERM)
45
46 go func() {
47 <-sigChan
48 cancel()
49 }()
50
51 return runPluginDocsDownload(ctx, cmd, args)
52 },
53 }
54 cmd.Flags().StringP("docs-dir", "D", "docs", "Path to the docs directory")
55
56 return cmd
57}
58
59func runPluginDocsDownload(ctx context.Context, cmd *cobra.Command, args []string) error {
60 tc := auth.NewTokenClient()

Callers 1

NewCmdRootFunction · 0.85

Calls 2

runPluginDocsDownloadFunction · 0.85
ContextMethod · 0.45

Tested by

no test coverage detected