#!perl

our $DATE = '2015-06-17'; # DATE
our $VERSION = '0.04'; # VERSION

use 5.010001;
use strict 'subs', 'vars';
use warnings;

use Getopt::Long::EvenLess;
use App::hr qw(hr);

my $color;
my $pattern;

GetOptions(
    'color|c=s' => sub { $color = $_[1] },
    'pattern|p=s' => sub { $pattern = $_[1] },
    'help|h|?' => sub {
        print <<'_';
hr - Print horizontal bar on the terminal

Usage:
  hr [options] [pattern]
  hr --help (or -h, -?)
  hr --version (-v)
Options:
  --color=s, -c    Color text, all Term::ANSIColor color expression is supported
  --pattern=s, -p  Set pattern (also via first argument)
_
        exit 0;
    },
    'version|v' => sub {
        say "hr version ", ${__PACKAGE__.'::VERSION'} // 'dev';
        exit 0;
    },
) or exit 1;
$pattern //= $ARGV[0] if @ARGV;
hr($pattern, $color);

# ABSTRACT: Print horizontal bar on the terminal
# PODNAME: hr

__END__

=pod

=encoding UTF-8

=head1 NAME

hr - Print horizontal bar on the terminal

=head1 VERSION

This document describes version 0.04 of hr (from Perl distribution App-hr), released on 2015-06-17.

=head1 SYNOPSIS

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

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

You can also use the C<hr> function in L<App::hr>.

=head1 HOMEPAGE

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

=head1 SOURCE

Source repository is at L<https://github.com/perlancar/perl-SHARYANTO-Term-Util>.

=head1 BUGS

Please report any bugs or feature requests on the bugtracker website L<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.

=head1 AUTHOR

perlancar <perlancar@cpan.org>

=head1 COPYRIGHT AND LICENSE

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.

=cut
