Skip to content

Commit

Permalink
Add more flaggers
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorAvelar committed Jun 2, 2021
1 parent 6b2e8d4 commit 04012e4
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions commands/flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ func AddCurrencyFlags(cmd *commander.Command) {
})
}

// AddCurrencyCodeFlag attaches the --currency flag to the given command.
func AddCurrencyCodeFlag(cmd *commander.Command) {
commander.AddFlag(cmd, commander.FlagConfig{
Name: CurrencyArg,
Usage: "the currency to receiving the minimumAmount and maximumAmount in",
})
}

// AddBillingCountryFlag attaches the --billing-country flag
// to the given command.
func AddBillingCountryFlag(cmd *commander.Command) {
Expand Down Expand Up @@ -72,3 +80,29 @@ func AddIDFlag(cmd *commander.Command, req bool) {
Required: req,
})
}

// AddIncludeFlag attaches the --include flag to the given command.
// It accepts a boolean to indicate if this flag should be a persistent
// field for the command.
func AddIncludeFlag(cmd *commander.Command, p bool) {
commander.AddFlag(cmd, commander.FlagConfig{
Name: IncludeArg,
Shorthand: "i",
Usage: "this resource allows to enrich the request by including other objects",
Persistent: p,
})
}

// AddPrompterFlag attaches the --prompt flag to the given command.
// It accepts a boolean to indicate if this flag should be a persistent
// field for the command.
func AddPrompterFlag(cmd *commander.Command, p bool) {
commander.AddFlag(cmd, commander.FlagConfig{
FlagType: commander.BoolFlag,
Name: "prompt",
Shorthand: "p",
Usage: "prompts for values instead of parsing them from flags (not required only)",
Persistent: p,
Default: false,
})
}

0 comments on commit 04012e4

Please sign in to comment.