diff options
author | Gereon Kremer <nafur42@gmail.com> | 2021-06-02 14:11:05 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-02 12:11:05 +0000 |
commit | 6d359817283f196034d8e36d0b9c1f10fb16d644 (patch) | |
tree | cb7d17927671a3b059575a86b55676eec922cef8 /src/main/main.cpp | |
parent | 61b2694ac72d41aeff9c67e3631278e5a3bea5cb (diff) |
Move public wrapper functions out of options class (#6600)
This PR moves options wrapper functions out of the Options class. These wrapper functions are meant to be called by "external" code that should not access the options modules. This PR thereby significantly reduces the interface of the Options class.
Diffstat (limited to 'src/main/main.cpp')
-rw-r--r-- | src/main/main.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/main/main.cpp b/src/main/main.cpp index b96598b0b..2b25e6c93 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -14,12 +14,13 @@ */ #include "main/main.h" +#include <stdio.h> +#include <unistd.h> + #include <cstdlib> #include <cstring> #include <fstream> #include <iostream> -#include <stdio.h> -#include <unistd.h> #include "base/configuration.h" #include "base/output.h" @@ -28,6 +29,7 @@ #include "options/language.h" #include "options/option_exception.h" #include "options/options.h" +#include "options/options_public.h" #include "parser/parser.h" #include "parser/parser_builder.h" #include "parser/parser_exception.h" @@ -51,25 +53,25 @@ int main(int argc, char* argv[]) { return runCvc5(argc, argv, opts); } catch(OptionException& e) { #ifdef CVC5_COMPETITION_MODE - *opts.getOut() << "unknown" << endl; + *options::getOut(opts) << "unknown" << endl; #endif cerr << "(error \"" << e << "\")" << endl << endl << "Please use --help to get help on command-line options." << endl; } catch(Exception& e) { #ifdef CVC5_COMPETITION_MODE - *opts.getOut() << "unknown" << endl; + *options::getOut(opts) << "unknown" << endl; #endif - if (language::isOutputLang_smt2(opts.getOutputLanguage())) + if (language::isOutputLang_smt2(options::getOutputLanguage(opts))) { - *opts.getOut() << "(error \"" << e << "\")" << endl; + *options::getOut(opts) << "(error \"" << e << "\")" << endl; } else { - *opts.getErr() << "(error \"" << e << "\")" << endl; + *options::getErr(opts) << "(error \"" << e << "\")" << endl; } - if (opts.getStatistics() && pExecutor != nullptr) + if (options::getStatistics(opts) && pExecutor != nullptr) { totalTime.reset(); - pExecutor->printStatistics(*opts.getErr()); + pExecutor->printStatistics(*options::getErr(opts)); } } exit(1); |