MCPcopy Create free account
hub / github.com/clouditor/clouditor / AddCommands

Function AddCommands

cli/commands/commands.go:46–64  ·  view source on GitHub ↗

AddCommands adds all subcommands

(cmd *cobra.Command)

Source from the content-addressed store, hash-verified

44
45// AddCommands adds all subcommands
46func AddCommands(cmd *cobra.Command) {
47 cmd.AddCommand(
48 // commands for resources
49 login.NewLoginCommand(),
50 catalog.NewCatalogCommand(),
51 metric.NewMetricCommand(),
52 tool.NewToolCommand(),
53 resource.NewResourceCommand(),
54 evidence.NewEvidenceCommand(),
55 assessmentresult.NewAssessmentResultCommand(),
56 completion.NewCompletionCommand(),
57 cloud.NewCloudCommand(),
58 // command consisting of service commands
59 service.NewServiceCommand(),
60 )
61
62 cmd.PersistentFlags().StringP(cli.SessionFolderFlag, "s", cli.DefaultSessionFolder, "the directory where the session will be saved and loaded from")
63 _ = viper.BindPFlag(cli.SessionFolderFlag, cmd.PersistentFlags().Lookup(cli.SessionFolderFlag))
64}

Callers 2

newRootCommandFunction · 0.92
TestAddCommandsFunction · 0.70

Calls 10

NewLoginCommandFunction · 0.92
NewCatalogCommandFunction · 0.92
NewMetricCommandFunction · 0.92
NewToolCommandFunction · 0.92
NewResourceCommandFunction · 0.92
NewEvidenceCommandFunction · 0.92
NewCompletionCommandFunction · 0.92
NewCloudCommandFunction · 0.92
NewServiceCommandFunction · 0.92

Tested by 1

TestAddCommandsFunction · 0.56