#
# This software may be freely distributed and used according to the terms
# of the GNU Lesser General Public License.
#
# This software may be freely distributed and used according to the terms
# of the GNU Lesser General Public License.
my $override_config = 0;
push @options, "config|C=s" => sub { my ($o,$a)=@_; $defargs .= " -C'$a'"; $override_config=1; };
push @options, "set|S=s" => sub { my ($o,$a)=@_; $defargs .= " -S'$a'"; };
my $override_config = 0;
push @options, "config|C=s" => sub { my ($o,$a)=@_; $defargs .= " -C'$a'"; $override_config=1; };
push @options, "set|S=s" => sub { my ($o,$a)=@_; $defargs .= " -S'$a'"; };
Getopt::Long::GetOptions(@options) or return 0;
if (!$override_config && $DefaultConfigFile) {
$defargs = "-C'$DefaultConfigFile' $defargs";
Getopt::Long::GetOptions(@options) or return 0;
if (!$override_config && $DefaultConfigFile) {
$defargs = "-C'$DefaultConfigFile' $defargs";
foreach my $section (keys %Sections) {
my $opts = $Sections{$section};
my $optlist = join(" ", keys %$opts);
foreach my $section (keys %Sections) {
my $opts = $Sections{$section};
my $optlist = join(" ", keys %$opts);
my @l = `bin/config $defargs $section $optlist`;
$? && exit 1;
foreach my $o (@l) {
$o =~ /^CF_([^=]+)='(.*)'\n$/ or die "Cannot parse bin/config output: $_";
my @l = `bin/config $defargs $section $optlist`;
$? && exit 1;
foreach my $o (@l) {
$o =~ /^CF_([^=]+)='(.*)'\n$/ or die "Cannot parse bin/config output: $_";