Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Nov 16, 2020. It is now read-only.

Commit1dd3e0e

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,POSTwill work properly.Also remove redundant "default: value" from description (it's beingadded by cobra anyway).
1 parentea6cb0e commit1dd3e0e

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
returncmd
6464
}
6565

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp