#!perl

# ABSTRACT: A command line tool to get a list of email addresses from particular Github account.

use strict;
use warnings;
use v5.10;

use App::Github::Email;
use Getopt::Long::Descriptive;

my ( $opt, $usage ) = describe_options(
    'github-email %o <github username>',
    [ 'username|u=s', 'Github username.',             { required     => 1 } ],
    [ 'help|h',       'Print this message and exit.', { shortcircuit => 1 } ]
);

print( $usage->text ), exit 0 if $opt->help;

my @addresses = App::Github::Email::get_user( $opt->username );

for my $address (@addresses) {
    say $address;
}

=head1 SYNOPSIS

    github-email --username <github username>

    # Examples

    github-email --username faraco
    github-email -u faraco
=cut

