Subject: | ARGCOUNT_HASH in Getopt is broken |
State->set expects (variable,value) and for ARGCOUNT_HASH items, it
should be ('define','verbose=loud').. but the Getopt wrapper passes
('define','verbose','loud') instead. (Getopt::Long does the work of
parsing the key/value pairs)
There were a few places where this could be fixed, but I choose to fix
it in AppConfig::Getopt. The attached patch modifies _getopt_state to
force Getopt::Long to handle ARGCOUNT_HASHes as an ARGCOUNT_LISTs
instead and the expected behavior of State->set parsing key/value pairs
is maintained.
This way, if there was ever a need for something more powerful, say
perhaps an ARGCOUNT_DEEP option, Getopt::Long wouldn't need to know how
to parse it correctly, only State->set..
EG: --option foo.bar.baz=1 might be option => { foo => { bar => { baz =>
1}}} )
SMF ;D
Subject: | AppConfig.patch.gz |
Message body not shown because it is not plain text.