Replace mutiple args with flags

AB#1955
This commit is contained in:
katexochen 2022-05-04 08:50:50 +02:00 committed by Paul Meyer
parent 469b2ff46c
commit 1189078c5a
10 changed files with 336 additions and 587 deletions

View file

@ -54,7 +54,8 @@ func init() {
cobra.EnableCommandSorting = false
// Set output of cmd.Print to stdout. (By default, it's stderr.)
rootCmd.SetOut(os.Stdout)
rootCmd.PersistentFlags().String("dev-config", "", "Set this flag to create the Constellation using settings from a development config.")
rootCmd.PersistentFlags().String("dev-config", "", "Set this flag to create the Constellation cluster using settings from a development config.")
must(rootCmd.MarkPersistentFlagFilename("dev-config", "json"))
rootCmd.AddCommand(newCreateCmd())
rootCmd.AddCommand(newInitCmd())
rootCmd.AddCommand(newVerifyCmd())
@ -62,3 +63,9 @@ func init() {
rootCmd.AddCommand(newTerminateCmd())
rootCmd.AddCommand(newVersionCmd())
}
func must(err error) {
if err != nil {
panic(err)
}
}