Skip to content

Commit

Permalink
Fix udpate conditioin issue "#2"
Browse files Browse the repository at this point in the history
  • Loading branch information
Chan Gao committed Oct 12, 2018
1 parent 3898459 commit 4bc7ab6
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/nr
/vendor
/dist
/test/fixture/output
/test/fixture/output
/my-debug
*.log
/.vscode
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ Available Commands:
Flags:
-h, --help help for get
-o, --output string Output format. table/json/yaml are supported (default "table")
-t, --type-condition string Alert condition type. Only used for 'alertsconditions' command. all|conditions|sythentics|ext|plugin|nrql are supported (default "all")
-t, --type-condition string Alert condition type. Only used for 'alertsconditions' command. all|conditions|synthetics|ext|plugin|nrql are supported (default "all")
```

<br>for `nr get users`, run:
Expand All @@ -228,7 +228,7 @@ Flags:
Global Flags:
-o, --output string Output format. table/json/yaml are supported (default "table")
-t, --type-condition string Alert condition type. Only used for 'alertsconditions' command. all|conditions|sythentics|ext|plugin|nrql are supported (default "all")
-t, --type-condition string Alert condition type. Only used for 'alertsconditions' command. all|conditions|synthetics|ext|plugin|nrql are supported (default "all")
```


Expand Down
2 changes: 1 addition & 1 deletion cmd/create/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func init() {
CreateCmd.PersistentFlags().StringP("file", "f", "", "Filename to create resource with, yaml/json format is supported.")
CreateCmd.MarkPersistentFlagRequired("file")

CreateCmd.PersistentFlags().StringP("type-condition", "t", "default", "Alert condition type. Only used for 'alertsconditions' command. default|sythentics|ext|plugin|nrql are supported")
CreateCmd.PersistentFlags().StringP("type-condition", "t", "default", "Alert condition type. Only used for 'alertsconditions' command. default|synthetics|ext|plugin|nrql are supported")

CreateCmd.PersistentFlags().StringP("output", "o", "json", "Output format. json/yaml are supported")

Expand Down
2 changes: 1 addition & 1 deletion cmd/delete/delete.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ func init() {

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
DeleteCmd.PersistentFlags().StringP("type-condition", "t", "default", "Alert condition type. Only used for 'alertsconditions' command. default|sythentics|ext|plugin|nrql are supported")
DeleteCmd.PersistentFlags().StringP("type-condition", "t", "default", "Alert condition type. Only used for 'alertsconditions' command. default|synthetics|ext|plugin|nrql are supported")

DeleteCmd.PersistentFlags().StringP("output", "o", "json", "Output format. json/yaml are supported")
// DeleteCmd.PersistentFlags().String("foo", "", "A help for foo")
Expand Down
2 changes: 1 addition & 1 deletion cmd/get/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ func init() {
// GetCmd.PersistentFlags().String("foo", "", "A help for foo")
GetCmd.PersistentFlags().StringP("output", "o", "table", "Output format. table/json/yaml are supported")

GetCmd.PersistentFlags().StringP("type-condition", "t", "all", "Alert condition type. Only used for 'alertsconditions' command. all|conditions|sythentics|ext|plugin|nrql are supported")
GetCmd.PersistentFlags().StringP("type-condition", "t", "all", "Alert condition type. Only used for 'alertsconditions' command. all|conditions|synthetics|ext|plugin|nrql are supported")
// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// GetCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
Expand Down
4 changes: 2 additions & 2 deletions cmd/get/get_alertsconditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import (

var alertsconditionsCmd = &cobra.Command{
Use: "alertsconditions",
Short: "Display alert conditions by alert id.",
Short: "Display alert conditions by alert policy id.",
Aliases: []string{"ac", "alertcondition", "alertscondition"},
Example: "nr get alertsconditions <id> -o json",
Example: "nr get alertsconditions <policy_id> -o json",
Args: func(cmd *cobra.Command, args []string) error {
if len(args) != 1 {
var err = fmt.Errorf("length of [flags] should be 1 instead of %d", len(args))
Expand Down
2 changes: 1 addition & 1 deletion cmd/update/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func init() {

UpdateCmd.PersistentFlags().StringP("output", "o", "json", "Output format. json/yaml are supported")

UpdateCmd.PersistentFlags().StringP("type-condition", "t", "default", "Alert condition type. Only used for 'alertsconditions' command. default|sythentics|ext|plugin|nrql are supported")
UpdateCmd.PersistentFlags().StringP("type-condition", "t", "default", "Alert condition type. Only used for 'alertsconditions' command. default|synthetics|ext|plugin|nrql are supported")

UpdateCmd.PersistentFlags().StringP("script-file", "s", "", "Synthetics monitor javascript file name. Only used for 'monitor' command.")
// Cobra supports local flags which will only run when this command
Expand Down

0 comments on commit 4bc7ab6

Please sign in to comment.