# HG changeset patch # User Frits van Bommel # Date 1244388055 -7200 # Node ID 7d3b47852a7ab087bad16434cbae804462c9c94a # Parent defafbabbe327d4d1a0f7de1ceb58b0a32475f6d Print the path to the configuration file being used if `-v` is passed. diff -r defafbabbe32 -r 7d3b47852a7a gen/configfile.cpp --- a/gen/configfile.cpp Sun Jun 07 16:00:13 2009 +0200 +++ b/gen/configfile.cpp Sun Jun 07 17:20:55 2009 +0200 @@ -89,6 +89,9 @@ } } + // save config file path for -v output + pathstr = p.toString(); + try { // read the cfg diff -r defafbabbe32 -r 7d3b47852a7a gen/configfile.h --- a/gen/configfile.h Sun Jun 07 16:00:13 2009 +0200 +++ b/gen/configfile.h Sun Jun 07 17:20:55 2009 +0200 @@ -2,6 +2,7 @@ #define LDC_CONF_CONFIGFILE_H #include +#include namespace libconfig { @@ -23,8 +24,11 @@ s_iterator switches_begin() { return switches.begin(); } s_iterator switches_end() { return switches.end(); } + const std::string& path() { return pathstr; } + private: libconfig::Config* cfg; + std::string pathstr; s_vector switches; }; diff -r defafbabbe32 -r 7d3b47852a7a gen/main.cpp --- a/gen/main.cpp Sun Jun 07 16:00:13 2009 +0200 +++ b/gen/main.cpp Sun Jun 07 17:20:55 2009 +0200 @@ -204,6 +204,13 @@ cl::SetVersionPrinter(&printVersion); cl::ParseCommandLineOptions(final_args.size(), (char**)&final_args[0], "LLVM-based D Compiler\n", true); + // Print config file path if -v was passed + if (global.params.verbose) { + const std::string& path = cfg_file.path(); + if (!path.empty()) + printf("config %s\n", path.c_str()); + } + // Negated options global.params.link = !compileOnly; global.params.obj = !dontWriteObj;