|
1 | 1 | #!/usr/bin/perl -w |
2 | | -#Last Updated: 2005.02.25 (xris) |
| 2 | +#Last Updated: 2005.03.09 (xris) |
3 | 3 | # |
4 | 4 | # cli.pm |
5 | 5 | # |
@@ -42,7 +42,7 @@ package nuv_export::cli; |
42 | 42 |
|
43 | 43 | # Load the nuvexportrc file |
44 | 44 | my %rc_args; |
45 | | - foreach my $file ($config_file, 'nuvexportrc', "$ENV{'HOME'}/.nuvexportrc", "/etc/.nuvexportrc") { |
| 45 | + foreach my $file ($config_file, 'nuvexportrc', "$ENV{'HOME'}/.nuvexportrc", "/etc/nuvexportrc") { |
46 | 46 | # No file |
47 | 47 | next unless ($file && -e $file); |
48 | 48 | # Slurp |
@@ -182,17 +182,26 @@ package nuv_export::cli; |
182 | 182 | # Scan the package from parent to child, looking for matches |
183 | 183 | my $path = $package; |
184 | 184 | while ($path) { |
185 | | - return $rc_args{$path}{$arg} if (defined $rc_args{$path}{$arg}); |
| 185 | + if (defined $rc_args{$path}{$arg}) { |
| 186 | + #print "$arg used from $path: $rc_args{$path}{$arg}\n"; |
| 187 | + return $rc_args{$path}{$arg}; |
| 188 | + } |
186 | 189 | last unless ($path =~ s/^.+?:://); |
187 | 190 | } |
188 | 191 | # Scan the package from child to parent, looking for matches |
189 | 192 | $path = $package; |
190 | 193 | while ($path) { |
191 | | - return $rc_args{$path}{$arg} if (defined $rc_args{$path}{$arg}); |
| 194 | + if (defined $rc_args{$path}{$arg}) { |
| 195 | + #print "$arg used from $path: $rc_args{$path}{$arg}\n"; |
| 196 | + return $rc_args{$path}{$arg}; |
| 197 | + } |
192 | 198 | last unless ($path =~ s/::.+?$//); |
193 | 199 | } |
194 | 200 | # Finally, try "generic" |
195 | | - return $rc_args{'generic'}{$arg} if (defined $rc_args{'generic'}{$arg}); |
| 201 | + if (defined $rc_args{'generic'}{$arg}) { |
| 202 | + #print "$arg used from generic: $rc_args{'generic'}{$arg}\n"; |
| 203 | + return $rc_args{'generic'}{$arg}; |
| 204 | + } |
196 | 205 | # Lastly, try "nuvexport" (or just return undef) |
197 | 206 | return $rc_args{'nuvexport'}{$arg}; |
198 | 207 | } |
|
0 commit comments