Skip to content

Commit

Permalink
fix: add required flags to rules create and delete commands (#52)
Browse files Browse the repository at this point in the history
Close A0CLI-39
  • Loading branch information
vprasanth authored Jan 26, 2021
1 parent 57b7089 commit 738873e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/cli/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,7 @@ func createRulesCmd(cli *cli) *cobra.Command {
cmd.Flags().StringVarP(&flags.script, "script", "s", "", "Code to be executed when this rule runs (required)")
cmd.Flags().IntVarP(&flags.order, "order", "o", 0, "Order that this rule should execute in relative to other rules. Lower-valued rules execute first.")
cmd.Flags().BoolVarP(&flags.enabled, "enabled", "e", false, "Whether the rule is enabled (true), or disabled (false).")
mustRequireFlags(cmd, "name", "script")
return cmd
}

Expand Down Expand Up @@ -220,6 +221,7 @@ func deleteRulesCmd(cli *cli) *cobra.Command {
}

cmd.Flags().StringVar(&flags.id, "id", "", "ID of the rule to delete (required)")
mustRequireFlags(cmd, "id")

return cmd
}
Expand Down

0 comments on commit 738873e

Please sign in to comment.