mirror of
https://github.com/xomboverlord/ldc.git
synced 2026-01-16 12:53:14 +01:00
Print the path to the configuration file being used if -v is passed.
This commit is contained in:
@@ -89,6 +89,9 @@ bool ConfigFile::read(const char* argv0, void* mainAddr, const char* filename)
|
||||
}
|
||||
}
|
||||
|
||||
// save config file path for -v output
|
||||
pathstr = p.toString();
|
||||
|
||||
try
|
||||
{
|
||||
// read the cfg
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#define LDC_CONF_CONFIGFILE_H
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
namespace libconfig
|
||||
{
|
||||
@@ -23,8 +24,11 @@ public:
|
||||
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;
|
||||
};
|
||||
|
||||
@@ -204,6 +204,13 @@ int main(int argc, char** argv)
|
||||
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;
|
||||
|
||||
Reference in New Issue
Block a user