Skip to content

Commit

Permalink
Get parameters passing correctly and remove unnecessary bits
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Kulash committed Jan 25, 2021
1 parent 000995e commit 4a46467
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions internal/cli/rules.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ func createRulesCmd(cli *cli) *cobra.Command {
auth0 rules create --name "My Rule" --script "function (user, context, callback) { console.log( 'Hello, world!' ); return callback(null, user, context); }"
`,
Args: cobra.MinimumNArgs(2),
RunE: func(cmd *cobra.Command, args []string) error {
r := &management.Rule{
Name: &flags.name,
Expand All @@ -80,12 +79,10 @@ func createRulesCmd(cli *cli) *cobra.Command {
},
}

cmd.Flags().StringVarP(&name, "name", "n", "", "Name of this rule (required)")
cmd.Flags().StringVarP(&script, "script", "s", "", "Code to be executed when this rule runs (required)")
cmd.Flags().IntVarP(&order, "order", "o", 0, "Order that this rule should execute in relative to other rules. Lower-valued rules execute first.")
cmd.Flags().BoolVarP(&enabled, "enabled", "e", false, "Whether the rule is enabled (true), or disabled (false).")
cmd.MarkFlagRequired("name")
cmd.MarkFlagRequired("script")
cmd.Flags().StringVarP(&flags.name, "name", "n", "", "Name of this rule (required)")
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).")

return cmd
}

0 comments on commit 4a46467

Please sign in to comment.