2022-03-22 15:03:15 +00:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2022-05-13 09:56:43 +00:00
|
|
|
"github.com/edgelesssys/constellation/internal/constants"
|
2022-03-22 15:03:15 +00:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2022-08-24 11:43:23 +00:00
|
|
|
func newRootCmd() *cobra.Command {
|
|
|
|
cmd := &cobra.Command{
|
|
|
|
Use: "cdbg",
|
|
|
|
Short: "Constellation debugging client",
|
|
|
|
Long: `cdbg is the constellation debugging client.
|
|
|
|
It connects to CoreOS instances running debugd and deploys a self-compiled version of the bootstrapper.`,
|
|
|
|
}
|
|
|
|
cmd.PersistentFlags().String("config", constants.ConfigFilename, "Constellation config file")
|
|
|
|
cmd.AddCommand(newDeployCmd())
|
|
|
|
return cmd
|
2022-03-22 15:03:15 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
// Execute starts the CLI.
|
|
|
|
func Execute() {
|
2022-08-24 11:43:23 +00:00
|
|
|
cmd := newRootCmd()
|
|
|
|
if err := cmd.Execute(); err != nil {
|
2022-03-22 15:03:15 +00:00
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|