-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathroot.go
More file actions
37 lines (31 loc) · 857 Bytes
/
root.go
File metadata and controls
37 lines (31 loc) · 857 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
/*
Copyright © 2025 NAME HERE <EMAIL ADDRESS>
*/
package cmd
import (
"os"
"github.com/codesphere-cloud/cs-go/pkg/io"
"github.com/spf13/cobra"
)
type GlobalOptions struct {
OmsPortalApiKey string
}
// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
opts := GlobalOptions{}
rootCmd := &cobra.Command{
Use: "oms",
Short: "Codesphere Operations Management System (OMS)",
Long: io.Long(`Codesphere Operations Management System (OMS)
This command can be used to run common tasks related to managing codesphere installations,
like downloading new versions.`),
}
AddInstallCmd(rootCmd)
AddListCmd(rootCmd, opts)
AddDownloadCmd(rootCmd, opts)
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}