Skip to content

Commit 82258ef

Browse files
committed
Add comments
1 parent 63cbc79 commit 82258ef

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

cli/clibase/option.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ func (s *OptionSet) Add(opts ...Option) {
8080
*s = append(*s, opts...)
8181
}
8282

83+
// Filter will only return options that match the given filter. (return true)
8384
func (s OptionSet) Filter(filter func(opt Option) bool) OptionSet {
8485
cpy := make(OptionSet, 0)
8586
for _, opt := range s {

cli/cliui/output.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,11 @@ func (textFormat) Format(_ context.Context, data any) (string, error) {
193193
return fmt.Sprintf("%s", data), nil
194194
}
195195

196+
// DataChangeFormat allows manipulating the data passed to an output format.
197+
// This is because sometimes the data needs to be manipulated before it can be
198+
// passed to the output format.
199+
// For example, you may want to pass something different to the text formatter
200+
// than what you pass to the json formatter.
196201
type DataChangeFormat struct {
197202
format OutputFormat
198203
change func(data any) (any, error)

0 commit comments

Comments
 (0)