()
| 13 | ) |
| 14 | |
| 15 | func GetCreateCmd() *cobra.Command { |
| 16 | createCmd := &cobra.Command{ |
| 17 | Use: createCmdName, |
| 18 | Short: createCmdDescription, |
| 19 | RunE: func(cmd *cobra.Command, _ []string) error { |
| 20 | if err := viper.BindPFlags(cmd.Flags()); err != nil { |
| 21 | return err |
| 22 | } |
| 23 | return nil |
| 24 | }, |
| 25 | } |
| 26 | flagSet := pflag.NewFlagSet(createCmdName, pflag.ExitOnError) |
| 27 | // Fixed params |
| 28 | flagSet.StringP(constants.ProjectName, "", "", constants.ProjectNameDesc) |
| 29 | flagSet.StringP(constants.BackedURL, "", "", constants.BackedURLDesc) |
| 30 | flagSet.StringP(constants.OutputFolder, "", "", constants.OutputFolderDesc) |
| 31 | flagSet.StringToStringP(constants.Tags, "", nil, constants.TagsDesc) |
| 32 | flagSet.StringP(constants.OcpPullSecretFilePath, "", "", constants.OcpPullSecretFilePathDesc) |
| 33 | flagSet.StringP(constants.KeyFilePath, "", "", constants.KeyFilePathDesc) |
| 34 | createCmd.PersistentFlags().AddFlagSet(flagSet) |
| 35 | |
| 36 | createCmd.AddCommand(getAWSProviderCmd()) |
| 37 | createCmd.AddCommand(getGCPProviderCmd()) |
| 38 | createCmd.AddCommand(getOpenStackProviderCmd()) |
| 39 | createCmd.AddCommand(getUPIProviderCmd()) |
| 40 | |
| 41 | return createCmd |
| 42 | } |
no test coverage detected