NAME

hr - Print horizontal bar on the terminal

VERSION

This document describes version 0.268 of main::_DataPacker (from Perl distribution App-hr), released on 2022-09-03.

SYNOPSIS

hr [--blink|-B|--no-blink|--noblink] [--color=str|-c=str] [--height=int|-H=int] [--random-color] [--random-pattern|-r] [--space-after=int|-a=int] [--space-before=int|-b=int] -- [pattern]

DESCRIPTION

hr can be useful as a marker/separator, especially if you use other commands that might produce a lot of output, and you need to scroll back lots of pages to see previous output. Example:

% hr; command-that-produces-lots-of-output
============================================================================
Command output
...
...
...

% hr -r; some-command; hr -r; another-command

Usage:

% hr
============================================================================

% hr -c red  ;# will output the same bar, but in red

% hr --random-color  ;# will output the same bar, but in random color

% hr x----
x----x----x----x----x----x----x----x----x----x----x----x----x----x----x----x

% hr -- -x-  ;# specify a pattern that starts with a dash
% hr -p -x-  ;# ditto

% hr --random-pattern
vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

% hr --random-pattern
*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---*---

% hr -r  ;# shortcut for --random-pattern --random-color

% hr -Br ;# a BLINKING random pattern, random color bar

% hr --help

If you use Perl, you can also use the hr function in App::hr module.

OPTIONS

* marks required options.

Main options

--blink, -B

Return a blinking bar.

--color=s, -c

Specify a color (see Term::ANSIColor).

--height=s, -H

Specify height (number of rows).

Default value:

1
--pattern=s, -p

Specify a pattern.

Can also be specified as the 1st command-line argument.

--random-color
--random-pattern
--space-after=s, -a

Number of empty rows after drawing the bar.

Default value:

0
--space-before=s, -b

Number of empty rows before drawing the bar.

Default value:

0
-r

Alias for --random-pattern --random-color.

See --random-pattern.

Other options

--help, -h, -?

Display help message and exit.

--version, -v

Display program's version and exit.

COMPLETION

The script comes with a companion shell completer script (_hr) for this script.

bash

To activate bash completion for this script, put:

complete -C _hr hr

in your bash startup (e.g. ~/.bashrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.

It is recommended, however, that you install modules using cpanm-shcompgen which can activate shell completion for scripts immediately.

tcsh

To activate tcsh completion for this script, put:

complete hr 'p/*/`hr`/'

in your tcsh startup (e.g. ~/.tcshrc). Your next shell session will then recognize tab completion for the command. Or, you can also directly execute the line above in your shell to activate immediately.

It is also recommended to install shcompgen (see above).

other shells

For fish and zsh, install shcompgen as described above.

HOMEPAGE

Please visit the project's homepage at https://metacpan.org/release/App-hr.

SOURCE

Source repository is at https://github.com/perlancar/perl-App-hr.

AUTHOR

perlancar <perlancar@cpan.org>

CONTRIBUTING

To contribute, you can send patches by email/via RT, or send pull requests on GitHub.

Most of the time, you don't need to build the distribution yourself. You can simply modify the code, then test via:

% prove -l

If you want to build the distribution (e.g. to try to install it locally on your system), you can install Dist::Zilla, Dist::Zilla::PluginBundle::Author::PERLANCAR, Pod::Weaver::PluginBundle::Author::PERLANCAR, and sometimes one or two other Dist::Zilla- and/or Pod::Weaver plugins. Any additional steps required beyond that are considered a bug and can be reported to me.

COPYRIGHT AND LICENSE

This software is copyright (c) 2022, 2021, 2020, 2018, 2016, 2015, 2014 by perlancar <perlancar@cpan.org>.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

BUGS

Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-hr

When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.