MIT licensed and maintained by Travis Cardwell
This version can be pinned in stack with:horizontal-rule-0.7.0.0@sha256:ae1b4bc0d9d69baac9eee14f8ba106a9c61c01981678610d6a0e2be5ab4f9ea0,3497

Module documentation for 0.7.0.0

hr

Project Status: Active – The project has reached a stable, usable state and is being actively developed. GitHub CI Hackage Stackage LTS Stackage Nightly

Overview

hr is a utility for displaying a horizontal rule in a terminal.

It is useful for marking a position in your terminal so that you can easily find it again. For example, use hr to display a horizontal rule before each build of a project so that you can easily find the beginning of the output of the last build.

CLI

Requirements

hr has only been tested on Linux. It might work on Windows and macOS.

Installation

.deb Package Installation

Check the Releases page for .deb packages.

.rpm Package Installation

Check the Releases page for .rpm packages.

Installation From Hackage

Install hr from Hackage using Cabal as follows:

$ cabal v2-install horizontal-rule

Installation From Stackage

Install hr from Stackage using Stack as follows:

$ stack install horizontal-rule

Usage

See the hr man page for usage information.

Examples

The rule fills with width of the terminal by default:

$ hr
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

In cases when the terminal width cannot be determined, a default width is used. This default width can be set with an option:

$ hr -d 78
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

If desired, the rule width can be specified:

$ hr -w 60
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

In cases where the terminal cannot display Unicode, ASCII may be used:

$ hr -a
------------------------------------------------------------------------------

The rule can include the current time:

$ hr -t
━━┫2021-05-27 19:26:09┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The time format can be specified:

$ hr -t -f "%H:%M:%S.%q"
━━┫19:30:44.861779179000┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

The first line read from STDIN can be used as a note:

$ uname -m | hr -i
━━┫x86_64┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

When input is read, a timeout is used to ensure that hr does not “hang” when there is no input. The timeout (in milliseconds) can be specified:

$ uname -m | hr -i --timeout 100
━━┫x86_64┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

A note can be specified as one or more arguments:

$ hr unit tests
━━┫unit tests┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Different types of notes can be combined:

$ uname -m | hr -it unit tests
━━┫2021-05-27 19:48:48┣━┫unit tests┣━┫x86_64┣━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Library

You can easily include horizontal rules in the output of your own Haskell software by using the library. The Haskell package is named horizontal-rule in Hackage and Stackage because there is an existing package named hR.

Project

Links

Branches

The main branch is reserved for releases. It may be considered stable, and HEAD is always the latest release.

The develop branch is the primary development branch. It contains changes that have not yet been released, and it is not necessarily stable.

Hackage revisions are made for metadata changes, such as relaxation of constraints when new versions of dependencies are released. The horizontal-rule.cabal metadata in the main branch may therefore not match that of Hackage. The horizontal-rule.cabal metadata in the develop branch may match, unless work is being done on a new release that contains other changes.

Tags

All releases are tagged in the main branch. Release tags are signed using the [email protected] GPG key.

Contribution

Issues and feature requests are tracked on GitHub: https://github.com/ExtremaIS/hr-haskell/issues

Issues may also be submitted via email to [email protected].

License

This project is released under the MIT License as specified in the LICENSE file.

Changes

hr-haskell Changelog

This project follows the Haskell package versioning policy, with versions in A.B.C.D format. A may be incremented arbitrarily for non-technical reasons, but semantic versioning is otherwise followed, where A.B is the major version, C is the minor version, and D is the patch version. Initial development uses versions 0.0.C.D, for which every version is considered breaking.

The format of this changelog is based on Keep a Changelog, with the following conventions:

  • Level-two heading Unreleased is used to track changes that have not been released.
  • Other level-two headings specify the release in A.B.C.D (YYYY-MM-DD) format, with newer versions above older versions.
  • Level-three headings are used to categorize changes as follows:
    1. Breaking
    2. Non-Breaking
  • Changes are listed in arbitrary order and present tense.

0.7.0.0 (2024-12-04)

Breaking

  • Remove support for GHC 8.6, constraining lower bounds
  • Remove support for GHC 8.4, constraining lower bounds
  • Remove support for GHC 8.2, constraining lower bounds
  • Change minimal Cabal from 1.24 to 3.0

Non-Breaking

  • Bump base dependency version upper bound
  • Bump tasty dependency version upper bound
  • Bump text dependency version upper bound
  • Bump time dependency version upper bound
  • Vendor HMock and explainable-predicates

0.6.0.0 (2023-05-28)

Breaking

  • Add support for optparse-applicative 0.18

Non-Breaking

  • Bump ansi-wl-pprint dependency version upper bound
  • Adjust dependency constraints to match tested versions

0.5.0.0 (2022-03-01)

Breaking

  • Rename Haskell package to horizontal-rule
  • Refactor API to use MonadTerminal instead of IO directly

Non-Breaking

  • Add mock tests
  • Bump text dependency version upper bound
  • Bump time dependency version upper bound
  • Bump optparse-applicative dependency version upper bound

0.4.0.0 (2021-06-25)

Breaking

  • Fix --help when using optparse-applicative 0.16

Non-Breaking

  • Refactor Nix configuration

0.3.0.1 (2021-05-28)

Non-Breaking

  • Add library usage example

0.3.0.0 (2021-05-28)

Breaking

  • Add library
  • Add --width and --default CLI options
  • Add --input and --timeout CLI options

0.2.0.1 (2021-05-27)

Non-Breaking

  • Fix link in README
  • Fix formatting in RPM description

0.2.0.0 (2021-05-26)

Breaking

  • Add support for optparse-applicative 0.16

Non-Breaking

  • Add .deb and .rpm packaging
  • Add Cabal support to Makefile
  • Add Cabal tests to GitHub Actions
  • Add stan static analysis

0.1.0.3 (2020-11-21)

Non-Breaking

  • Use GitHub Actions instead of Travis CI

0.1.0.2 (2020-11-05)

Non-Breaking

  • Rename Git default branch to main
  • Refactor Makefile, add STACK_NIX_PATH support
  • Add test-all command to Makefile
  • Add Nix configuration

0.1.0.1 (2019-12-29)

Non-Breaking

  • Fix operator for compatibility with GHC 8.2.2

0.1.0.0 (2019-12-29)

Breaking

  • Initial public release