App-BitBucketCli

 view release on metacpan or  search on metacpan

lib/App/BitBucketCli/Command/Branches.pm  view on Meta::CPAN

package App::BitBucketCli::Command::Branches;

# Created on: 2018-06-07 08:23:20
# Create by:  Ivan Wills
# $Id$
# $Revision$, $HeadURL$, $Date$
# $Revision$, $Source$, $Date$

use Moo;
use warnings;
use Carp;
use Data::Dumper qw/Dumper/;
use English qw/ -no_match_vars /;

extends 'App::BitBucketCli';

our $VERSION = 0.009;

sub options {
    return [qw/
        colors|c=s%
        force|f!
        long|l
        project|p=s
        recipient|R=s
        regexp|R
        remote|m=s
        repository|r=s
        sleep|s=i
    /]
}

sub branches {
    my ($self) = @_;

    my @pull_requests = sort {
            lc $a->id cmp lc $b->id;
        }
        $self->core->branches($self->opt->{project}, $self->opt->{repository});

    for my $pull_request (@pull_requests) {
        print $pull_request->id . ' - ' . $pull_request->title . "\n";
    }
}

1;

__END__

=head1 NAME

App::BitBucketCli::Command::Branches - Show branches of a repository

=head1 VERSION

This documentation refers to App::BitBucketCli::Command::Branches version 0.009

=head1 SYNOPSIS

   bb-cli branch [options]

 OPTIONS:
  -c --colors[=]str Change colours used specified as key=value
                    eg --colors disabled=grey22
                    current colour names aborted, disabled and notbuilt
  -f --force        Force action
  -l --long         Show long form data if possible
  -p --project[=]str
                    For commands that need a project name this is the name to use
  -R --recipient[=]str
                    ??
  -R --regexp[=]str ??



( run in 0.953 second using v1.01-cache-2.11-cpan-39bf76dae61 )