X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=lib%2FApp%2FCodeowners%2FOptions.pm;h=3c1eb1d26381717147eeb3dcd833c324989ee152;hb=b0c68e542b342b93b6f316562d3d586e9a0666cd;hp=67dc3243c7a5c08645386fc8568aad336241c612;hpb=4c0f6ed552c529fc6a3a09ffb6de91d6344ac790;p=chaz%2Fgit-codeowners diff --git a/lib/App/Codeowners/Options.pm b/lib/App/Codeowners/Options.pm index 67dc324..3c1eb1d 100644 --- a/lib/App/Codeowners/Options.pm +++ b/lib/App/Codeowners/Options.pm @@ -1,15 +1,36 @@ package App::Codeowners::Options; # ABSTRACT: Getopt and shell completion for App::Codeowners +use v5.10.1; use warnings; use strict; use Getopt::Long 2.39 (); use Path::Tiny; -use Pod::Usage; our $VERSION = '9999.999'; # VERSION +sub pod2usage { + eval { require Pod::Usage }; + if ($@) { + my $ref = $VERSION eq '9999.999' ? 'master' : "v$VERSION"; + my $exit = (@_ == 1 && $_[0] =~ /^\d+$/ && $_[0]) // + (@_ % 2 == 0 && {@_}->{'-exitval'}) // 2; + print STDERR < (-t STDOUT ? 1 : 0), ## no critic (InputOutput::ProhibitInteractiveTest) @@ -30,8 +51,13 @@ sub command_options { 'patterns' => { 'owner=s' => '', }, + 'projects' => {}, 'show' => { - 'project!' => 1, + 'owner=s@' => [], + 'pattern=s@' => [], + 'project=s@' => [], + 'patterns!' => 0, + 'projects!' => undef, }, 'update' => {}, };