## Coverage Report

#### Created: 2023-09-09 18:04

    .../cutbox_command/Sources/CutBoxCLICore/OutputManager.swift

    Line

    Count

    Source

    1

    import Foundation

    2

    3

    struct OutputManager {

    4

    13

        func printItemWithTime(_ item: HistoryEntry) -> String {

    5

    13

            return "\(item.timestamp ?? "UNKNOWN DATETIME"): \(item.string)"

    6

    13

        }

    7

    8

    29

        func printItem(_ item: HistoryEntry) -> String {

    9

    29

            return item.string

    10

    29

        }

    11

    12

    24

        func printEntries(_ entries: [HistoryEntry], params: CommandParams, out: Output) {

    13

    24

            let printFunc: (HistoryEntry) -> String

    14

    24

            if params.showTime {

    15

    17

                printFunc = printItemWithTime

    $s13CutBoxCLICore13OutputManagerV12printEntries_6params3outySayAA12HistoryEntryVG_AA13CommandParamsCAA0D0CtFSSAHcACcfu_

    Line

    Count

    Source

    15

    4

                printFunc = printItemWithTime

    $s13CutBoxCLICore13OutputManagerV12printEntries_6params3outySayAA12HistoryEntryVG_AA13CommandParamsCAA0D0CtFSSAHcACcfu_SSAHcfu0_

    Line

    Count

    Source

    15

    13

                printFunc = printItemWithTime

    16

    24

            } else {

    17

    49

                printFunc = printItem

    $s13CutBoxCLICore13OutputManagerV12printEntries_6params3outySayAA12HistoryEntryVG_AA13CommandParamsCAA0D0CtFSSAHcACcfu1_

    Line

    Count

    Source

    17

    20

                printFunc = printItem

    $s13CutBoxCLICore13OutputManagerV12printEntries_6params3outySayAA12HistoryEntryVG_AA13CommandParamsCAA0D0CtFSSAHcACcfu1_SSAHcfu2_

    Line

    Count

    Source

    17

    29

                printFunc = printItem

    18

    24

            }

    19

    24

    20

    24

            let formattedEntries = entries.map(printFunc).joined(separator: "\n")

    21

    24

            out.print(formattedEntries)

    22

    24

        }

    23

    }