From e268acbdf8a242ebffd7f5b041d96d9125dd6ed9 Mon Sep 17 00:00:00 2001 From: spjspj Date: Fri, 7 Jul 2017 21:42:49 +1000 Subject: [PATCH] Add argument. Can go say: gen_all_files_in_dck.pl basic to find just basics or gen_all_files_in_dck.pl basic | grep "HOU:" to find just HOU basics. --- Utils/gen_all_files_in_dck.pl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Utils/gen_all_files_in_dck.pl b/Utils/gen_all_files_in_dck.pl index 23d143341d..86fe829fec 100644 --- a/Utils/gen_all_files_in_dck.pl +++ b/Utils/gen_all_files_in_dck.pl @@ -28,6 +28,8 @@ sub toCamelCase return $string; } +my $option = $ARGV[0]; + open (DATA, $setsFile) || die "can't open $setsFile"; while(my $line = ) { @@ -37,7 +39,7 @@ while(my $line = ) } close(DATA); -my $dir_listing = "dir \/a \/b \/s ..\\Mage.Sets\\ | find \".java\" |"; +my $dir_listing = "dir \/a \/b \/s ..\\Mage.Sets\\src\\mage\\sets | find \".java\" |"; open (DIR_LISTING, "$dir_listing"); my %setsForJavafile; my $totalCards = 0; @@ -78,7 +80,12 @@ while () $setsForJavafile {$f} = $trigraph; } - if ($line =~ m/SetCardInfo\("([^"]+)",([^,]+),/img) + if ($line !~ m/$option/img) + { + next; + } + + if ($line =~ m/SetCardInfo\("([^"]+)",([^,]+),/im) { $name = $1; $cardNum = $2;