|
|
@ -56,6 +56,15 @@ sub save_cursor { |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sub yaml_convert_bool { |
|
|
|
|
|
|
|
my $val = shift; |
|
|
|
|
|
|
|
if ( $val =~ m/^y|Y|yes|Yes|YES|true|True|TRUE$/ ){ |
|
|
|
|
|
|
|
return 1; |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
return 0; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#### End Routines #### |
|
|
|
#### End Routines #### |
|
|
|
|
|
|
|
|
|
|
|
GetOptions ( |
|
|
|
GetOptions ( |
|
|
@ -90,6 +99,11 @@ foreach ( keys %{ $cmd } ){ |
|
|
|
$conf->{$_} = $cmd->{$_} if ( $cmd->{$_} ); |
|
|
|
$conf->{$_} = $cmd->{$_} if ( $cmd->{$_} ); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# YAML::Tiny doesn't handle boolean |
|
|
|
|
|
|
|
foreach my $key ( qw(compress keep_alive) ) { |
|
|
|
|
|
|
|
$conf->{$key} = yaml_convert_bool($conf->{$key}); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
# Now check config makes sens |
|
|
|
# Now check config makes sens |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
not $conf->{url} or |
|
|
|
not $conf->{url} or |
|
|
|