debug api requests given on command line v0.3
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 11 May 2019 14:53:57 +0000 (16:53 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Sat, 11 May 2019 15:03:01 +0000 (17:03 +0200)
getsc2clan

index b1a5ebdcc25085ad749d13b0ba9acbdd2a5ee048..328553523d7b6834281c05b2a5a26afa0c3fa49b 100755 (executable)
@@ -8,8 +8,13 @@ use LWP::Authen::OAuth2;
 use JSON qw( decode_json );
 use List::MoreUtils qw( all part nsort_by );
 
 use JSON qw( decode_json );
 use List::MoreUtils qw( all part nsort_by );
 
+if (@ARGV and all { m[/] } @ARGV) {
+       say pp blizget($_) for @ARGV;
+       exit;
+}
+
 my ($profiles, $clanmatches) = part { /\D/ } @ARGV;  # separate numbers
 my ($profiles, $clanmatches) = part { /\D/ } @ARGV;  # separate numbers
-@{$profiles}
+$profiles && @{$profiles}
        or die "Usage: $0 <profile id>... [<clan name>...]\n";
 my ($clanmatch) = map { $_ && qr/\A(?:$_)\z/i } join '|', @{$clanmatches};
 
        or die "Usage: $0 <profile id>... [<clan name>...]\n";
 my ($clanmatch) = map { $_ && qr/\A(?:$_)\z/i } join '|', @{$clanmatches};