Skip to content

Headers and Footers

Wes Bailey edited this page Jul 21, 2017 · 12 revisions

Writing reports sometimes requires some formatted output delineating sections or require a report title to make it easier to read. Command Line Reporter give you a couple of methods to make this task trivial. Here is the API:

  • header(hash) and footer(hash)
    • :title - The title text for the section. Default: 'Report'
    • :width - The width in characters for the section. Default: 100
    • :align - 'left'|'right'|'center' align the title text. Default: 'left'
    • :spacing - Number of vertical lines to leave as spacing after|before the header|footer. Default: 1
    • :timestamp - Include a line indicating the timestamp below|above the header|footer text. Either true|false. Default: false
    • :rule - true|false indicates whether to include a horizontal rule below|above the header|footer. Default: false
    • :color - The color to use for the terminal output i.e. 'red' or 'blue' or 'green'
    • :bold - true|false to boldface the font

Examples

header title: 'Pinterest Report', width: 80, align: 'center', rule: true, color: 'green', bold: true, timestamp: true

Screenshot

Clone this wiki locally