-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathauth.go
30 lines (26 loc) · 901 Bytes
/
auth.go
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
package auth
import (
activateserviceaccount "github.com/stackitcloud/stackit-cli/internal/cmd/auth/activate-service-account"
"github.com/stackitcloud/stackit-cli/internal/cmd/auth/login"
"github.com/stackitcloud/stackit-cli/internal/cmd/auth/logout"
"github.com/stackitcloud/stackit-cli/internal/pkg/args"
"github.com/stackitcloud/stackit-cli/internal/pkg/print"
"github.com/stackitcloud/stackit-cli/internal/pkg/utils"
"github.com/spf13/cobra"
)
func NewCmd(p *print.Printer) *cobra.Command {
cmd := &cobra.Command{
Use: "auth",
Short: "Authenticates the STACKIT CLI",
Long: "Authenticates in the STACKIT CLI.",
Args: args.NoArgs,
Run: utils.CmdHelp,
}
addSubcommands(cmd, p)
return cmd
}
func addSubcommands(cmd *cobra.Command, p *print.Printer) {
cmd.AddCommand(login.NewCmd(p))
cmd.AddCommand(logout.NewCmd(p))
cmd.AddCommand(activateserviceaccount.NewCmd(p))
}