@@ -22,7 +22,8 @@ sub print_usage() {
2222 say " \t\t\t The default is 'a', which means all variables will be changed to a0,a1,a2,a3,..." ;
2323 say " \t\t -C\t is an option to clean out full line comments and blank lines." ;
2424 say " \t\t -F\t is an option to flatten out the code (remove indentations)" ;
25- say " \t\t -A\t is an option to aggressive obfuscation (implies using -F and -C)(tries to put more content on same line when possible)" ;
25+ say " \t\t -A\t is an option to aggressive obfuscation, one line (implies using -F and -C)" ;
26+ say " \t\t -N\t is an option to not obfuscate variable names" ;
2627 say " \t\t -I\t is an option to ignore specific variables in the obfuscation process, separated by commas (default: usage,args)" ;
2728 exit 0;
2829}
@@ -64,12 +65,17 @@ sub parse_cmd_args {
6465 say " Input or output file not specified!!" ;
6566 &print_usage();
6667 }
67- return ($input_file ,$output_file ,$new_variable_prefix ,$delete_blanks ,$flatten ,$aggressive ,$ignore_vars );
68+ return ($input_file , $output_file , $new_variable_prefix , $delete_blanks , $flatten , $aggressive , $ignore_vars );
6869}
6970
7071sub parse_vars_from_file {
7172 my $file_name =shift ;
7273 my $ignore_vars =shift ;
74+
75+ if ($ignore_vars eq " *" ) {
76+ return ();
77+ }
78+
7379 open (my $file_handle , " <" , $file_name ) || die " Couldn't open '" .$file_name ." ' for reading because: " .$! ;
7480 my %vars =();
7581 my $skip_next_line =0;
@@ -132,8 +138,12 @@ sub parse_vars_from_file {
132138 }
133139
134140 # go through $ignore_vars split by ,
135- for my $name (split /,/, $ignore_vars ) {
136- delete $vars {$name };
141+ for my $re (split /,/, $ignore_vars ) {
142+ for my $var (keys %vars ) {
143+ if ($var =~ m /$re / ) {
144+ delete $vars {$var };
145+ }
146+ }
137147 }
138148
139149 close $file_handle ;
0 commit comments