forked from opiproject/godpu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.go
46 lines (40 loc) · 1016 Bytes
/
main.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// SPDX-License-Identifier: Apache-2.0
// Copyright (c) 2022-2023 Dell Inc, or its subsidiaries.
// Package main implements the CLI commands
package main
import (
"log"
"os"
"github.com/opiproject/godpu/cmd/inventory"
"github.com/opiproject/godpu/cmd/ipsec"
"github.com/opiproject/godpu/cmd/network"
"github.com/opiproject/godpu/cmd/storage"
"github.com/spf13/cobra"
)
func main() {
command := newCommand()
if err := command.Execute(); err != nil {
log.Fatalf("[ERROR] %s", err.Error())
}
}
func newCommand() *cobra.Command {
//
// This is the root command for the CLI
//
c := &cobra.Command{
Use: "godpu",
Short: "godpu - DPUs and IPUs cli commands",
Run: func(cmd *cobra.Command, _ []string) {
err := cmd.Help()
if err != nil {
log.Fatalf("[ERROR] %s", err.Error())
}
os.Exit(1)
},
}
c.AddCommand(inventory.NewInventoryCommand())
c.AddCommand(ipsec.NewIPSecCommand())
c.AddCommand(storage.NewStorageCommand())
c.AddCommand(network.NewEvpnCommand())
return c
}