#!/usr/bin/perl
use strict;

my $APP      = 'set_single_color';
our $VERSION = '0.125';

use Getopt::Long;
use Pod::Usage;
use Term::ExtendedColor::Xresources qw(set_xterm_color);

our($index, $color) = (0, '9dff00');

GetOptions(
  'i|index:i' => \$index,
  'c|color:s' => \$color,
  'h|help'    => sub { pod2usage(verbose => 1) and exit; },
  'v|version' => sub { print "$APP v$VERSION\n" and exit; },
  'm|man'     => sub { pod2usage(verbose => 3) and exit; },
);


my $result = set_xterm_color( {$index => $color} );
print "Changing color index $index to color $color\n";
print values %{$result};


__END__

=pod

=head1 NAME

set_single_color - redefine a single color resource

=head1 DESCRIPTION

set_single_color demonstrates the function with the same name imported from
L<Term::ExtendedColor::Xresources>.

=head1 OPTIONS

  -i, --index   index color (0..255) to change
  -c, --color   specify color in hexadecimal

  -h, --help    show the help and exit
  -v, --version show version info and exit
  -m, --man     show the manual and exit

=head1 AUTHOR

  Magnus Woldrich
  CPAN ID: WOLDRICH
  magnus@trapd00r.se
  http://japh.se

=head1 CONTRIBUTORS

None required yet.

=head1 COPYRIGHT

Copyright 2010, 2011 B<THIS PROGRAM>s L</AUTHOR> and L</CONTRIBUTORS> as listed
above.

=head1 LICENSE

This program is free software; you may redistribute it and/or modify it under
the same terms as Perl itself.

=cut
