Skip to content

Consider less verbose Action signature #2

@pedromss

Description

@pedromss

Just a thought but you introduce 2 types to make the func taken by SetAction a little easier on the eyes:

type CliArgs map[string]commando.ArgValue
type CliFlags flags map[string]commando.FlagValue
SetAction(func(args CliArgs, flags CliFlags) {
   ...   
})

Client code would have easier to read signatures on these actions.

Or event a single struct to hold both:

type Cli struct {
	Args map[string]commando.ArgValue
	Flags map[string]commando.FlagValue
}
SetAction(func(cli Cli) {
   ...   
})

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions