Skip to content

Commit

Permalink
mention app.Preprocessor in implementations of it
Browse files Browse the repository at this point in the history
  • Loading branch information
telyn committed Dec 7, 2018
1 parent 218b212 commit 3f03a55
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion cmd/bytemark/app/flags/account_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ func (name *AccountNameFlag) Set(value string) error {
}

// Preprocess sets the value of this flag to the global account flag if it's unset,
// and then runs lib.ParseAccountName
// and then runs lib.ParseAccountName. This is an implementation of `app.Preprocessor`,
// which is detected and called automatically by actions created with `app.Action`
func (name *AccountNameFlag) Preprocess(c *app.Context) (err error) {
if name.Value == "" {
name.Value = c.Context.GlobalString("account")
Expand Down
3 changes: 3 additions & 0 deletions cmd/bytemark/app/flags/group_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ func (name *GroupNameFlag) Set(value string) error {

// Preprocess defaults the value of this flag to the default group from the
// config attached to the context and then runs lib.ParseGroupName
// This is an implementation of `app.Preprocessor`, which is detected and
// called automatically by actions created with `app.Action`

func (name *GroupNameFlag) Preprocess(c *app.Context) (err error) {
if name.GroupName != nil {
c.Debug("GroupName.Preprocess before %#v", *name.GroupName)
Expand Down
2 changes: 2 additions & 0 deletions cmd/bytemark/app/flags/privilege.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ func (pf *PrivilegeFlag) Set(value string) (err error) {

// Preprocess parses the Privilege and looks up the target's ID so it can
// be made into a brain.Privilege
// This is an implementation of `app.Preprocessor`, which is detected and
// called automatically by actions created with `app.Action`
func (pf *PrivilegeFlag) Preprocess(c *app.Context) (err error) {
args := privArgs(strings.Split(pf.Value, " "))

Expand Down
2 changes: 2 additions & 0 deletions cmd/bytemark/app/flags/virtual_machine_name.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ func (name *VirtualMachineNameFlag) Set(value string) error {

// Preprocess defaults the value of this flag to the default server from the
// config attached to the context and then runs lib.ParseVirtualMachineName
// This is an implementation of `app.Preprocessor`, which is detected and
// called automatically by actions created with `app.Action`
func (name *VirtualMachineNameFlag) Preprocess(c *app.Context) (err error) {
if name.Value == "" {
return
Expand Down

0 comments on commit 3f03a55

Please sign in to comment.