Skip Menu |

This queue is for tickets about the AppConfig CPAN distribution.

Report information
The Basics
Id: 14294
Status: new
Priority: 0/
Queue: AppConfig

People
Owner: Nobody in particular
Requestors:
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: CREATE setting doesn't work for command line arguments
Setting CREATE to a true value in global configuration object works fine for configuration files, but not for parsing command-line arguments. The following test script show the issue: #!/usr/bin/perl use AppConfig; my $config = AppConfig->new({ CREATE => 1 }); $config->args(); [guillaume@pomerol cameroun]$ ./test.pl --foobar --foobar: invalid option
The following patch just fix the issue, using the same code as in File.pm
--- Args.pm 2005-08-24 16:40:37.000000000 +0200 +++ Args.pm.new 2005-08-24 16:40:52.000000000 +0200 @@ -101,7 +101,8 @@ } # check the variable exists - if ($state->_exists($variable)) { + if ($state->_exists($variable) + || $state->set($variable, 1)) { # see if it expects any mandatory arguments $nargs = $state->_argcount($variable);