(format string, args []any, opts ...noteOptions)
| 28 | } |
| 29 | |
| 30 | func (o Output) printNoteWithOptions(format string, args []any, opts ...noteOptions) { |
| 31 | if !o.noColor { |
| 32 | // TODO: Handle all flags |
| 33 | format = strings.ReplaceAll(format, "--platform", ColorFlag.Apply("--platform")) |
| 34 | } |
| 35 | |
| 36 | opt := &options{ |
| 37 | header: InfoHeader, |
| 38 | } |
| 39 | |
| 40 | for _, override := range opts { |
| 41 | override(opt) |
| 42 | } |
| 43 | |
| 44 | h := o.Sprint(opt.header) |
| 45 | |
| 46 | _, _ = fmt.Fprint(o, "\n", h) |
| 47 | s := fmt.Sprintf(format, args...) |
| 48 | for idx, line := range strings.Split(s, "\n") { |
| 49 | if idx > 0 { |
| 50 | _, _ = fmt.Fprint(o, strings.Repeat(" ", Width(h))) |
| 51 | } |
| 52 | |
| 53 | l := line |
| 54 | if !o.noColor { |
| 55 | l = aec.Italic.Apply(l) |
| 56 | } |
| 57 | _, _ = fmt.Fprintln(o, l) |
| 58 | } |
| 59 | } |
| 60 | |
| 61 | func (o Output) PrintNote(format string, args ...any) { |
| 62 | o.printNoteWithOptions(format, args, withHeader(InfoHeader)) |
no test coverage detected