X-Git-Url: http://git.shiar.nl/sc2-widget/blobdiff_plain/5ef3c506795b686dc532c78f8b9fd40d3aeb75a1..3d1855ba5c9dc7171edf0382e0b456e49be822db:/getsc2clan diff --git a/getsc2clan b/getsc2clan index b1a5ebd..9e6222a 100755 --- a/getsc2clan +++ b/getsc2clan @@ -8,10 +8,15 @@ 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}; +my ($clanmatch) = map { $_ && qr/\A(?:$_)\z/i } join '|', @{$clanmatches || []}; sub blizget { state $bliz = do {