hr-lite - Print horizontal bar on the terminal
This document describes version 0.01 of hr-lite (from Perl distribution App-hr-Lite), released on 2015-07-12.
Usage:
% hr-lite [options] [pattern]
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
% hr; command-that-produces-lots-of-output ============================================================================ Command output ... ... ... % hr -r; some-command; hr -r; another-command
% 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 --help
If you use Perl, you can also use the hr function in App::hr module.
App::hr
* marks required options.
*
Set path to configuration file.
Can be specified multiple times.
Set configuration profile to use.
Do not use any configuration file.
Do not read environment for default options.
Specify a color (see Term::ANSIColor).
Display help message and exit.
Specify a pattern.
Display program's version and exit.
Alias for --random-pattern --random-color.
See --random-pattern.
--random-pattern
This script has shell tab completion capability with support for several shells.
To activate bash completion for this script, put:
complete -C hr-lite hr-lite
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.
~/.bashrc
It is recommended, however, that you install shcompgen which allows you to activate completion scripts for several kinds of scripts on multiple shells. Some CPAN distributions (those that are built with Dist::Zilla::Plugin::GenShellCompletion) will even automatically enable shell completion for their included scripts (using shcompgen) at installation time, so you can immadiately have tab completion.
shcompgen
To activate tcsh completion for this script, put:
complete hr-lite 'p/*/`hr-lite`/'
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.
~/.tcshrc
It is also recommended to install shcompgen (see above).
For fish and zsh, install shcompgen as described above.
HR_LITE_OPT
Specify additional command-line options
This script can read configuration file, which by default is searched at ~/.config/hr-lite.conf, ~/hr-lite.conf or /etc/hr-lite.conf (can be changed by specifying --config-path). All found files will be read and merged.
~/.config/hr-lite.conf
~/hr-lite.conf
/etc/hr-lite.conf
--config-path
To disable searching for configuration files, pass --no-config.
--no-config
Configuration file is in the format of IOD, which is basically INI with some extra features.
You can put multiple profiles in a single file by using section names like [profile=SOMENAME]. Those sections will only be read if you specify the matching --config-profile SOMENAME.
[profile=SOMENAME]
--config-profile SOMENAME
List of available configuration parameters:
color (see --color) pattern (see --pattern) random_color (see --random-color) random_pattern (see --random-pattern)
Please visit the project's homepage at https://metacpan.org/release/App-hr-Lite.
Source repository is at https://github.com/perlancar/perl-App-hr-Lite.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-hr-Lite
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.
perlancar <perlancar@cpan.org>
This software is copyright (c) 2015 by 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.
To install App::hr::Lite, copy and paste the appropriate command in to your terminal.
cpanm
cpanm App::hr::Lite
CPAN shell
perl -MCPAN -e shell install App::hr::Lite
For more information on module installation, please visit the detailed CPAN module installation guide.