2022-09-05 03:06:08 -04:00
|
|
|
/*
|
|
|
|
Copyright (c) Edgeless Systems GmbH
|
|
|
|
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
*/
|
|
|
|
|
2023-01-24 10:08:04 -05:00
|
|
|
// Package cmd contains the cdbg CLI.
|
2022-03-22 11:03:15 -04:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"os"
|
|
|
|
|
2022-09-21 07:47:57 -04:00
|
|
|
"github.com/edgelesssys/constellation/v2/internal/constants"
|
2022-03-22 11:03:15 -04:00
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
2022-08-24 07:43:23 -04:00
|
|
|
func newRootCmd() *cobra.Command {
|
|
|
|
cmd := &cobra.Command{
|
|
|
|
Use: "cdbg",
|
|
|
|
Short: "Constellation debugging client",
|
|
|
|
Long: `cdbg is the constellation debugging client.
|
2022-10-21 04:16:44 -04:00
|
|
|
It connects to Constellation instances running debugd and deploys a self-compiled version of the bootstrapper.`,
|
2022-08-24 07:43:23 -04:00
|
|
|
}
|
|
|
|
cmd.PersistentFlags().String("config", constants.ConfigFilename, "Constellation config file")
|
2023-01-31 05:45:31 -05:00
|
|
|
cmd.PersistentFlags().Bool("force", false, "disables version validation errors - might result in corrupted clusters")
|
|
|
|
|
2022-08-24 07:43:23 -04:00
|
|
|
cmd.AddCommand(newDeployCmd())
|
|
|
|
return cmd
|
2022-03-22 11:03:15 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// Execute starts the CLI.
|
|
|
|
func Execute() {
|
2022-08-24 07:43:23 -04:00
|
|
|
cmd := newRootCmd()
|
|
|
|
if err := cmd.Execute(); err != nil {
|
2022-03-22 11:03:15 -04:00
|
|
|
os.Exit(1)
|
|
|
|
}
|
|
|
|
}
|