SMT-RAT  24.02
Toolbox for Strategic and Parallel Satisfiability-Modulo-Theories Solving
handle_options.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "config.h"
4 #include "ExitCodes.h"
6 #include <carl-common/compile_info/CompileInfo.h>
9 
10 namespace smtrat {
11 namespace options_detail {
12 
14  std::cout << "CMake options used for CArL:" << std::endl;
15  std::cout << carl::CMakeOptions() << std::endl;
16  std::cout << std::endl;
17  std::cout << "CMake options used for SMT-RAT:" << std::endl;
18  std::cout << smtrat::CMakeOptions() << std::endl;
19 }
20 
21 void print_info() {
22  std::cout << "Version: " << smtrat::compile_information::GitVersion << std::endl;
23  std::cout << "Code is based on commit " << smtrat::compile_information::GitRevisionSHA1 << ". " << std::endl;
24  std::cout << "Build type: " << smtrat::compile_information::BuildType << std::endl;
25  std::cout << "Code was compiled with compiler " << smtrat::compile_information::CXXCompiler << " " << smtrat::compile_information::CXXCompilerVersion << std::endl;
26  std::cout << "Build on a " << smtrat::compile_information::SystemName << " (" << compile_information::SystemVersion << ") machine." << std::endl;
27 }
28 
29 void print_license() {
30  std::string license = LICENSE_CONTENT;
31  std::replace( license.begin(), license.end(), ';', '\n');
32  std::cout << license << std::endl;
33 }
34 
35 void print_version() {
36  std::cout << compile_information::ProjectName << " " << compile_information::Version << std::endl;
37  std::cout << compile_information::GitVersion << " based on " << compile_information::GitRevisionSHA1 << std::endl;
38 }
39 
40 }
41 
43  if (settings_core().show_help) {
44  std::cout << parser.print_help() << std::endl;
45  return SMTRAT_EXIT_SUCCESS;
46  }
47  if (settings_core().show_info) {
49  return SMTRAT_EXIT_SUCCESS;
50  }
51  if (settings_core().show_version) {
53  return SMTRAT_EXIT_SUCCESS;
54  }
55  if (settings_core().show_settings) {
56  std::cout << parser.print_options() << std::endl;
57  return SMTRAT_EXIT_SUCCESS;
58  }
59  if (settings_core().show_cmake_options) {
61  return SMTRAT_EXIT_SUCCESS;
62  }
63  if (settings_core().show_license) {
65  return SMTRAT_EXIT_SUCCESS;
66  }
67 
68  return SMTRAT_EXIT_UNDEFINED;
69 }
70 
71 }
constexpr int SMTRAT_EXIT_SUCCESS
Definition: ExitCodes.h:12
constexpr int SMTRAT_EXIT_UNDEFINED
Definition: ExitCodes.h:10
#define LICENSE_CONTENT
Definition: config.h:3
Class to create the formulas for axioms.
int handle_basic_options(const SettingsParser &parser)
const auto & settings_core()
Definition: Settings.h:100
constexpr CMakeOptionPrinter CMakeOptions(bool advanced=false) noexcept