Skip to content

Commit 7c49a68

Browse files
committed
style: merge command
1 parent 5a64b2f commit 7c49a68

File tree

3 files changed

+8
-5
lines changed

3 files changed

+8
-5
lines changed

cmd/sponge/commands/generate/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ func ConfigCommand() *cobra.Command {
6969
cmd.Flags().StringVarP(&ysArgs.InputFile, "yaml-file", "f", "", "yaml file")
7070
cmd.Flags().StringVarP(&outPath, "out", "o", "", "output directory, default is ./config_<time>")
7171

72+
cmd.AddCommand(
73+
ConfigmapCommand(), // k8s configmap command
74+
)
75+
7276
return cmd
7377
}
7478

cmd/sponge/commands/generate/configmap.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ func ConfigmapCommand() *cobra.Command {
2121
)
2222

2323
cmd := &cobra.Command{
24-
Use: "configmap",
24+
Use: "cm",
2525
Short: "Generate k8s configmap",
2626
Long: "Generate k8s configmap.",
2727
Example: color.HiBlackString(` # Generate k8s configmap
28-
sponge configmap --server-name=yourServerName --project-name=yourProjectName --config-file=yourConfigFile.yml
28+
sponge config cm --server-name=yourServerName --project-name=yourProjectName --config-file=yourConfigFile.yml
2929
30-
# Generate grpc connection code and specify the server directory, Note: code generation will be canceled when the latest generated file already exists.
31-
sponge configmap --server-name=yourServerName --project-name=yourProjectName --config-file=yourConfigFile.yml --out=./yourServerDir`),
30+
# Generate k8s configmap and specify the server directory, Note: code generation will be canceled when the latest generated file already exists.
31+
sponge config cm --server-name=yourServerName --project-name=yourProjectName --config-file=yourConfigFile.yml --out=./yourServerDir`),
3232
SilenceErrors: true,
3333
SilenceUsage: true,
3434
RunE: func(cmd *cobra.Command, args []string) error {

cmd/sponge/commands/root.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ Docs: %s`, color.HiCyanString("https://github.com/zhufuyi/sponge"), color.HiCyan
3535
GenWebCommand(),
3636
GenMicroCommand(),
3737
generate.ConfigCommand(),
38-
generate.ConfigmapCommand(),
3938
OpenUICommand(),
4039
MergeCommand(),
4140
PatchCommand(),

0 commit comments

Comments
 (0)