From: Mischa POSLAWSKY Date: Sat, 11 May 2019 14:53:57 +0000 (+0200) Subject: debug api requests given on command line X-Git-Tag: v0.3 X-Git-Url: http://git.shiar.nl/sc2-widget/commitdiff_plain/refs/tags/v0.3?hp=5ef3c506795b686dc532c78f8b9fd40d3aeb75a1 debug api requests given on command line --- diff --git a/getsc2clan b/getsc2clan index b1a5ebd..3285535 100755 --- a/getsc2clan +++ b/getsc2clan @@ -8,8 +8,13 @@ use LWP::Authen::OAuth2; 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 -@{$profiles} +$profiles && @{$profiles} or die "Usage: $0 ... [...]\n"; my ($clanmatch) = map { $_ && qr/\A(?:$_)\z/i } join '|', @{$clanmatches};