From db96528baa55151826442f61ddfea2cd006ef68d Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 4 Apr 2020 17:25:56 -0400 Subject: config, where used without document processing --- org/in_source_files.org | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'org/in_source_files.org') diff --git a/org/in_source_files.org b/org/in_source_files.org index eb813db..05e9889 100644 --- a/org/in_source_files.org +++ b/org/in_source_files.org @@ -56,7 +56,7 @@ import #+NAME: meta_config_file_hub #+BEGIN_SRC d template readConfigSite() { - @system final auto readConfigSite(C)(C _conf_file_details) { + @system final auto readConfigSite(C,O)(C _conf_file_details, O _opt_action) { mixin spineRgxIn; static auto rgx = RgxI(); string conf_filename = "NONE"; @@ -114,6 +114,9 @@ webserv: try { if (exists(conf_file)) { if (conf_file.getLinkAttributes.attrIsFile) { + if (_opt_action.verbose || _opt_action.very_verbose || _opt_action.debug_do) { + writeln("config file used: \"", conf_file, "\" (cli flag settings override config file's individual settings)"); + } config_file_str = conf_file.readText; break; } @@ -137,7 +140,7 @@ webserv: config_file_str = default_config_file_str; } } - if (config_file_str.length == 0) { /+ create dummy default config file +/ + if (config_file_str.length == 0) { /+ use dummy default config file +/ writeln("WARNING config file NOT found, default provided"); conf_filename = "VIRTUAL"; config_file_str = default_config_file_str; @@ -176,7 +179,7 @@ static template readConfigDoc() { static auto rgx = RgxI(); string config_file_str; string conf_filename = "NONE"; - auto _conf_file_details = ConfigFilePaths!()(_manifested, _env); + auto _conf_file_details = configFilePaths!()(_manifested, _env); string[] possible_config_path_locations = _conf_file_details.possible_config_path_locations.dr_document_make; foreach(conf_fn; [_conf_file_details.config_filename_document]) { foreach(pth; possible_config_path_locations) { @@ -228,7 +231,7 @@ static template configReadSiteYAML() { <>; @safe final YAMLDocument configReadSiteYAML(M,E)(M _manifested, E _env) { string _configuration = configReadInSiteYAML!()(_manifested, _env); - auto _conf_file_details = ConfigFilePaths!()(_manifested, _env); + auto _conf_file_details = configFilePaths!()(_manifested, _env); string _conf_yaml_fn = _conf_file_details.config_filename_site; YAMLDocument _yaml_conf = configYAML!()(_configuration, _conf_yaml_fn); return _yaml_conf; @@ -240,7 +243,7 @@ static template configReadDocYAML() { <>; @safe final YAMLDocument configReadDocYAML(M,E)(M _manifested, E _env) { string _configuration = configReadInDocYAML!()(_manifested, _env); - auto _conf_file_details = ConfigFilePaths!()(_manifested, _env); + auto _conf_file_details = configFilePaths!()(_manifested, _env); string _conf_yaml_fn = _conf_file_details.config_filename_document; YAMLDocument _yaml_conf = configYAML!()(_configuration, _conf_yaml_fn); return _yaml_conf; -- cgit v1.2.3