From fa1409f974e0baab7e4372bb60a56156cd13de8c Mon Sep 17 00:00:00 2001 From: barnettZQG Date: Wed, 9 Feb 2022 15:17:04 +0800 Subject: [PATCH] Fix: fix flag conflict (#3211) Signed-off-by: barnettZQG --- Makefile | 5 ++++- references/cli/def.go | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index caae9a224..2f7569ae0 100644 --- a/Makefile +++ b/Makefile @@ -9,9 +9,12 @@ include makefiles/e2e.mk all: build # Run tests -test: vet lint staticcheck unit-test-core +test: vet lint staticcheck unit-test-core test-cli-gen @$(OK) unit-tests pass +test-cli-gen: + mkdir -p ./bin/doc + go run ./hack/docgen/gen.go ./bin/doc unit-test-core: go test -coverprofile=coverage.txt $(shell go list ./pkg/... ./cmd/... ./apis/... | grep -v apiserver) go test $(shell go list ./references/... | grep -v apiserver) diff --git a/references/cli/def.go b/references/cli/def.go index 0b4bf3e07..1bd1b0d8d 100644 --- a/references/cli/def.go +++ b/references/cli/def.go @@ -279,7 +279,7 @@ func NewDefinitionInitCommand(c common.Args) *cobra.Command { } cmd.Flags().StringP(FlagType, "t", "", "Specify the type of the new definition. Valid types: "+strings.Join(pkgdef.ValidDefinitionTypes(), ", ")) cmd.Flags().StringP(FlagDescription, "d", "", "Specify the description of the new definition.") - cmd.Flags().StringP(FlagTemplateYAML, "y", "", "Specify the template yaml file that definition will use to build the schema. If empty, a default template for the given definition type will be used.") + cmd.Flags().StringP(FlagTemplateYAML, "f", "", "Specify the template yaml file that definition will use to build the schema. If empty, a default template for the given definition type will be used.") cmd.Flags().StringP(FlagOutput, "o", "", "Specify the output path of the generated definition. If empty, the definition will be printed in the console.") cmd.Flags().BoolP(FlagInteractive, "i", false, "Specify whether use interactive process to help generate definitions.") cmd.Flags().StringP(FlagProvider, "p", "", "Specify which provider the cloud resource definition belongs to. Only `alibaba`, `aws`, `azure` are supported.")