Skip to content
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit 1dd3e0e

Browse files
authored
Use StringSlice instead of StringArray in API CLI (#772)
`StringSlice` allows comma separated values, so commands like: dispatch create api --method GET,POST will work properly. Also remove redundant "default: value" from description (it's being added by cobra anyway).
1 parent ea6cb0e commit 1dd3e0e

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pkg/dispatchcli/cmd/create_api.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ func NewCmdCreateAPI(out io.Writer, errOut io.Writer) *cobra.Command {
5353
}
5454

5555
cmd.Flags().StringVarP(&cmdFlagApplication, "application", "a", "", "associate with an application")
56-
cmd.Flags().StringArrayVarP(&hosts, "domain", "d", []string{}, "domain names that point to your API (multi-values), default: empty")
57-
cmd.Flags().StringArrayVarP(&paths, "path", "p", []string{"/"}, "relative paths that point to your API (multi-values), default: /")
58-
cmd.Flags().StringArrayVarP(&methods, "method", "m", []string{"GET"}, "methods that point to your API, default: GET")
59-
cmd.Flags().BoolVar(&httpsOnly, "https-only", false, "only support https connections, default: false")
60-
cmd.Flags().BoolVar(&disable, "disable", false, "disable the api, default: false")
61-
cmd.Flags().BoolVar(&cors, "cors", false, "enable CORS, default: false")
62-
cmd.Flags().StringVar(&auth, "auth", "public", "specify end-user authentication method, (e.g. public, basic, oauth2), default: public")
56+
cmd.Flags().StringSliceVarP(&hosts, "domain", "d", []string{}, "domain names that point to your API. Use multiple times or separate with commas to specify more values.")
57+
cmd.Flags().StringSliceVarP(&paths, "path", "p", []string{"/"}, "relative paths that point to your API. Use multiple times or separate with commas to specify more values.")
58+
cmd.Flags().StringSliceVarP(&methods, "method", "m", []string{"GET"}, "methods that point to your API. Use multiple times or separate with commas to specify more values.")
59+
cmd.Flags().BoolVar(&httpsOnly, "https-only", false, "only support https connections")
60+
cmd.Flags().BoolVar(&disable, "disable", false, "disable the api")
61+
cmd.Flags().BoolVar(&cors, "cors", false, "enable CORS")
62+
cmd.Flags().StringVar(&auth, "auth", "public", "specify end-user authentication method, (e.g. public, basic, oauth2)")
6363
return cmd
6464
}
6565

0 commit comments

Comments
 (0)