diff --git a/pkg/command/arguments.go b/pkg/command/arguments.go index 1e6ec93..f60b6b8 100644 --- a/pkg/command/arguments.go +++ b/pkg/command/arguments.go @@ -182,6 +182,11 @@ func (arg *Argument) SetValue(value []string) { arg.provided = &value } +// Repeats tells if an argument should be presented as a list. +func (arg *Argument) Repeats() bool { + return arg.Variadic +} + func (arg *Argument) IsKnown() bool { return arg.provided != nil && len(*arg.provided) > 0 } diff --git a/pkg/command/options.go b/pkg/command/options.go index cc03d56..a1af3cf 100644 --- a/pkg/command/options.go +++ b/pkg/command/options.go @@ -137,6 +137,11 @@ func (opt *Option) ToString() string { return stringValue } +// Repeats tells if an option should be presented as a list. +func (opt *Option) Repeats() bool { + return opt.Repeated +} + func (opt *Option) internalValidate(name, current string) error { if current == "" { return nil