App-GitHub

 view release on metacpan or  search on metacpan

lib/App/GitHub.pm  view on Meta::CPAN

        @logins,
    );
    $self->{prompt} = "$owner/$name> ";
}

sub set_login {
    my ( $self, $login ) = @_;

    ( $login, my $pass ) = split( /\s+/, $login, 2 );
    unless ( $login and $pass ) {
        $self->print("Wrong login args ($login $pass), eg fayland password");
        return;
    }

    $self->_do_login( $login, $pass );
}

sub set_loadcfg {
    my ( $self, $ign ) = @_;

    my $login = `git config --global github.user`;

scripts/github.pl  view on Meta::CPAN

Getopt::Long::Configure("bundling");

use 5.010;

if ( @ARGV == 0 ) {
    App::GitHub->new->run(@ARGV);
}
else {

    # Let's define some options!
    my ( $create, $username, $password, $key, $name, $fork, $help );
    GetOptions(
        'create|c=s'   => \$create,
        'key|k=s'      => \$key,
        'name|n=s'     => \$name,
        'fork|f=s'     => \$fork,
        'username|u=s' => \$username,
        'password|p=s' => \$password,
        'help'         => \$help,
    );

    my $github = App::GitHub->new( silent => 1 );
    if ($help) {
        pod2usage(1);
    }

    unless ( $username and $password ) {
        $github->set_loadcfg;
    }
    else {
        $github->set_login("$username $password");
    }

    if ($create) {
        eval { $github->repo_create($create); };

        if ($@) {
            say STDERR "Could not create repo $create";
            print STDERR $@;
        }
        else {

scripts/github.pl  view on Meta::CPAN

=head1 VERSION

version 1.0.1

=head1 SYNOPSIS

github.pl [options]

When run with no options, drops you to the github command line.

If --username and --password aren't passed in, github.user and github.pass from .gitconfig are used

Options:

    --username='username'
    --password='password'
    --create='name of repo to create'
    --key='pubkey' --name='name of key'
    --fork='name of repo to fork'
    --help

=head1 NAME

github.pl - Interact with github.com through the command line

=head1 OPTIONS

scripts/github.pl  view on Meta::CPAN

Fork the given github repo to your account

=item B<--help>

Print help text and exit

=item B<--username>

Github username 

=item B<--password>

Github password

=back

=head1 AUTHOR

William Orr <will@worrbase.com>

Please report bugs L<here|https://github.com/worr/perl-app-github/>

=head1 AUTHORS



( run in 0.777 second using v1.01-cache-2.11-cpan-49f99fa48dc )