mirror of https://github.com/digint/btrbk
btrbk: abort if cmdline specified config not found
parent
799d235218
commit
b77abb3eff
7
btrbk
7
btrbk
|
@ -4321,7 +4321,7 @@ sub _config_collect_values
|
||||||
|
|
||||||
sub init_config(@)
|
sub init_config(@)
|
||||||
{
|
{
|
||||||
my %defaults = ( CONTEXT => "meta", @_ );
|
my %defaults = ( CONTEXT => "meta", SRC_FILE => "DEFAULTS", @_ );
|
||||||
# set defaults
|
# set defaults
|
||||||
foreach (keys %config_options) {
|
foreach (keys %config_options) {
|
||||||
next if $config_options{$_}->{deprecated}; # don't pollute hash with deprecated options
|
next if $config_options{$_}->{deprecated}; # don't pollute hash with deprecated options
|
||||||
|
@ -5584,8 +5584,9 @@ MAIN:
|
||||||
$config = parse_config($config_file);
|
$config = parse_config($config_file);
|
||||||
exit 2 unless($config);
|
exit 2 unless($config);
|
||||||
}
|
}
|
||||||
elsif($fallback_default_config) {
|
elsif($fallback_default_config && !$config_cmdline) {
|
||||||
INFO "Configuration file not found, falling back to defaults";
|
INFO "Configuration file not found: " . join(', ', @config_src);
|
||||||
|
INFO "Using default configuration";
|
||||||
$config = init_config();
|
$config = init_config();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Reference in New Issue