Skip to content

Commit

Permalink
chore: fix arg descriptions
Browse files Browse the repository at this point in the history
  • Loading branch information
srinandan committed Nov 22, 2023
1 parent 05f12c6 commit 721e4cb
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
3 changes: 2 additions & 1 deletion cmd/apicategories/apicategories.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ var Cmd = &cobra.Command{
Long: "Manage Apigee API categories that are tagged on catalog items",
}

var org, siteid, name string
var org, siteid, id string

func init() {
Cmd.PersistentFlags().StringVarP(&org, "org", "o",
Expand All @@ -36,6 +36,7 @@ func init() {
Cmd.AddCommand(ListCmd)
Cmd.AddCommand(GetCmd)
Cmd.AddCommand(DelCmd)
Cmd.AddCommand(CreateCmd)

_ = Cmd.MarkFlagRequired("org")
_ = Cmd.MarkFlagRequired("siteid")
Expand Down
4 changes: 3 additions & 1 deletion cmd/apicategories/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ var CreateCmd = &cobra.Command{
},
}

var name string

func init() {
CreateCmd.Flags().StringVarP(&name, "name", "n",
"", "Catalog name")
"", "API Category name")
_ = CreateCmd.MarkFlagRequired("name")
}
12 changes: 6 additions & 6 deletions cmd/apicategories/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,19 @@ import (
// DelCmd to get a catalog items
var DelCmd = &cobra.Command{
Use: "delete",
Short: "Deletes a catalog item",
Long: "Deletes a catalog item",
Short: "Deletes an API Category by ID",
Long: "Deletes an API Category by ID",
Args: func(cmd *cobra.Command, args []string) (err error) {
return apiclient.SetApigeeOrg(org)
},
RunE: func(cmd *cobra.Command, args []string) (err error) {
_, err = apicategories.Delete(siteid, name)
_, err = apicategories.Delete(siteid, id)
return
},
}

func init() {
DelCmd.Flags().StringVarP(&name, "name", "n",
"", "Catalog name")
_ = DelCmd.MarkFlagRequired("name")
DelCmd.Flags().StringVarP(&id, "id", "i",
"", "API Category ID")
_ = DelCmd.MarkFlagRequired("id")
}
12 changes: 6 additions & 6 deletions cmd/apicategories/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ import (
// GetCmd to get a catalog items
var GetCmd = &cobra.Command{
Use: "get",
Short: "Gets a catalog item",
Long: "Gets a catalog item",
Short: "Gets an API Category by ID",
Long: "Gets an API Category by ID",
Args: func(cmd *cobra.Command, args []string) (err error) {
return apiclient.SetApigeeOrg(org)
},
RunE: func(cmd *cobra.Command, args []string) (err error) {
_, err = apicategories.Get(siteid, name)
_, err = apicategories.Get(siteid, id)
return
},
}

func init() {
GetCmd.Flags().StringVarP(&name, "name", "n",
"", "Catalog name")
_ = GetCmd.MarkFlagRequired("name")
GetCmd.Flags().StringVarP(&id, "id", "i",
"", "API Category ID")
_ = GetCmd.MarkFlagRequired("id")
}

0 comments on commit 721e4cb

Please sign in to comment.