29 const std::string &_optstring,
32 const std::string &program)
33 : parse_result(cmdline.parse(
36 (std::string(
"?h(help)") + _optstring).c_str())),
37 ui_message_handler(cmdline, program),
38 log(ui_message_handler)
59 auto const suggestions =
61 if(!suggestions.empty())
64 if(suggestions.size() > 1)
111 catch(
const std::string &e)
127 catch(
const std::bad_alloc &)
132 catch(
const std::exception &e)
150 const std::string &front_end)
153 <<
sizeof(
void *) * CHAR_BIT <<
"-bit "
160 auto const total_length = std::size_t{63};
161 auto const border = std::string{
"* *"};
163 total_length - std::min(total_length, 2 * border.size() + text.size());
164 auto const fill_right = fill / 2;
165 auto const fill_left = fill - fill_right;
166 return border + std::string(fill_left,
' ') + text +
167 std::string(fill_right,
' ') + border;
173 const std::string version_str = front_end +
" " + version +
" " +
virtual bool isset(char option) const
std::vector< std::string > get_argument_suggestions(const std::string &unknown_argument)
static irep_idt this_architecture()
static irep_idt this_operating_system()
Base class for exceptions thrown in the cprover project.
Thrown when users pass incorrect command line arguments, for example passing no files to analysis or ...
std::string what() const override
A human readable description of what went wrong.
A logic error, augmented with a distinguished field to hold a backtrace.
mstreamt & status() const
virtual void usage_error()
parse_options_baset(const std::string &optstring, int argc, const char **argv, const std::string &program)
void unknown_option_msg()
Print an error message mentioning the option that was not recognized when parsing the command line.
void log_version_and_architecture(const std::string &front_end)
Write version and system architecture to log.status().
Document and give macros for the exit codes of CPROVER binaries.
#define CPROVER_EXIT_INTERNAL_OUT_OF_MEMORY
Memory allocation has failed and this has been detected within the program.
#define CPROVER_EXIT_USAGE_ERROR
A usage error is returned when the command line is invalid or conflicting.
#define CPROVER_EXIT_EXCEPTION
An (unanticipated) exception was thrown during computation.
std::string align_center_with_border(const std::string &text)
Utility for displaying help centered messages borderered by "* *".
std::string banner_string(const std::string &front_end, const std::string &version)
void install_signal_catcher()
std::string to_string(const string_not_contains_constraintt &expr)
Used for debug printing.
Stream & join_strings(Stream &&os, const It b, const It e, const Delimiter &delimiter, TransformFunc &&transform_func)
Prints items to an stream, separated by a constant delimiter.
const char * CBMC_VERSION