diff options
Diffstat (limited to 'common/command.cc')
-rw-r--r-- | common/command.cc | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/common/command.cc b/common/command.cc index 4822585c..209f8cab 100644 --- a/common/command.cc +++ b/common/command.cc @@ -358,7 +358,14 @@ int CommandHandler::exec() if (executeBeforeContext()) return 0; - std::unique_ptr<Context> ctx = createContext(); + std::unordered_map<std::string,Property> values; + if (vm.count("json")) { + std::string filename = vm["json"].as<std::string>(); + std::ifstream f(filename); + if (!load_json_settings(f, filename, values)) + log_error("Loading design failed.\n"); + } + std::unique_ptr<Context> ctx = createContext(values); settings = std::unique_ptr<Settings>(new Settings(ctx.get())); setupContext(ctx.get()); setupArchContext(ctx.get()); |