#!/usr/bin/env perl

# ABSTRACT: Open a browser window with the GitHub URL of the repository which you are currently inside of
# PODNAME: gh-open

use strict;
use warnings;

use Browser::Open qw( open_browser );
use Getopt::Long;
use Git::Helpers qw( https_remote_url );

my $branch;
GetOptions ( 'branch' => \$branch );

open_browser( https_remote_url( shift @ARGV, $branch ));
exit;

__END__

=pod

=encoding UTF-8

=head1 NAME

gh-open - Open a browser window with the GitHub URL of the repository which you are currently inside of

=head1 VERSION

version 0.000009

=head1 SYNOPSIS

    # open repo for "origin" on GitHub using your default browser
    gh-open

    # open repo for "upstream" on GitHub using your default browser
    gh-open upstream

    # open repo to your current branch
    gh-open -b
    gh-open -b upstream

=head1 AUTHOR

Olaf Alders <olaf@wundercounter.com>

=head1 COPYRIGHT AND LICENSE

This software is copyright (c) 2015-2017 by Olaf Alders.

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
