Subject: | reads only one config file while MooseX::SimpleConfig accepts many |
Date: | Mon, 28 Apr 2014 09:55:28 +0000 |
To: | "bug-MooseX-Getopt [...] rt.cpan.org" <bug-MooseX-Getopt [...] rt.cpan.org> |
From: | "Valuet, Olivier" <Olivier.Valuet [...] morganstanley.com> |
hi,
note: first time ever reporting an issue... I tried to be concise...
in MooseX::SimpleConfig, the method get_config_from_file accepts several config files:
my $files_ref = ref $file eq 'ARRAY' ? $file : [$file];
however, in MooseX::Getopt::Basic, the method process_argv, accepts only one config file thru option -configfile of command line:
$opt_parser->getoptions( "configfile=s" => \$configfile );
for consistency, "configfile=s" should be "configfile=s@".
I tested that change and it worked fine when I pass two config files from command line.
pls, let me know. thx. olivier
* the perl file:
package MyOptions;
use Config::General;
use Moose;
use namespace::autoclean;
with 'MooseX::Getopt';
with 'MooseX::SimpleConfig';
has 'a' => (is=>'ro', isa=>'Str');
has 'b' => (is=>'ro', isa=>'Str');
__PACKAGE__->meta->make_immutable();
1;
package main;
my $o = MyOptions->new_with_options();
* the command line:
myperl.pl --configfile file1.cnf --configfile file2.cnf
* the config files:
file1.cnf: a=atest
file2.cnf: b=btest
Show quoted text
________________________________
NOTICE: Morgan Stanley is not acting as a municipal advisor and the opinions or views contained herein are not intended to be, and do not constitute, advice within the meaning of Section 975 of the Dodd-Frank Wall Street Reform and Consumer Protection Act. If you have received this communication in error, please destroy all electronic and paper copies and notify the sender immediately. Mistransmission is not intended to waive confidentiality or privilege. Morgan Stanley reserves the right, to the extent permitted under applicable law, to monitor electronic communications. This message is subject to terms available at the following link: http://www.morganstanley.com/disclaimers If you cannot access these links, please notify us by reply message and we will send the contents to you. By messaging with Morgan Stanley you consent to the foregoing.
Message body is not shown because it is too large.