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^0 X-Git-Url: http://git.shiar.nl/sc2-widget/commitdiff_plain/40a676b7222ed578faa199dc285e9310e92deaf8 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};