Skip to content

Commit

Permalink
Add support for string slice arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
Omar committed Nov 27, 2023
1 parent 71bdab5 commit 8b1baaf
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions cli/cli/command_framework/lowlevel/flags/parsed_flags.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,19 @@ func (flags *ParsedFlags) GetString(name string) (string, error) {
}
return value, nil
}

func (flags *ParsedFlags) GetStringSlice(name string) ([]string, error) {
value, err := flags.cmdFlagsSet.GetStringSlice(name)
if err != nil {
return []string{}, stacktrace.Propagate(
err,
"An error occurred getting string slice flag '%v'",
name,
)
}
return value, nil
}

func (flags *ParsedFlags) GetUint32(name string) (uint32, error) {
value, err := flags.cmdFlagsSet.GetUint32(name)
if err != nil {
Expand All @@ -34,6 +47,7 @@ func (flags *ParsedFlags) GetUint32(name string) (uint32, error) {
}
return value, nil
}

func (flags *ParsedFlags) GetBool(name string) (bool, error) {
value, err := flags.cmdFlagsSet.GetBool(name)
if err != nil {
Expand Down

0 comments on commit 8b1baaf

Please sign in to comment.