cprover
Loading...
Searching...
No Matches
crangler_parse_options.cpp
Go to the documentation of this file.
1/*******************************************************************\
2
3Module: CRANGLER Command Line Option Processing
4
5Author: Daniel Kroening, dkr@amazon.com
6
7\*******************************************************************/
8
11
13
14#include <util/cout_message.h>
15#include <util/exit_codes.h>
16#include <util/version.h>
17
18#include <json/json_parser.h>
19
20#include <iostream>
21
22#include "c_wrangler.h"
23
25{
26 if(cmdline.args.empty())
27 {
28 std::cerr << "please give a configuration file\n";
30 }
31
32 for(const auto &file_name : cmdline.args)
33 process_crangler_json(file_name);
34
35 return 0;
36}
37
39 const std::string &file_name)
40{
41 console_message_handlert message_handler;
42 jsont configuration;
43
44 if(parse_json(file_name, message_handler, configuration))
45 return;
46
47 c_wrangler(configuration);
48}
49
51{
52 std::cout << '\n'
53 << banner_string("CRANGLER", CBMC_VERSION) << '\n'
54 << "\n"
55 "Usage: Purpose:\n"
56 "\n"
57 " crangler [-?] [-h] [--help] show help\n"
58 " crangler file.json ... configuration file names\n"
59 "\n";
60}
void c_wrangler(const jsont &config)
C Wrangler.
argst args
Definition cmdline.h:145
void process_crangler_json(const std::string &file_name)
Definition json.h:27
CRANGLER Command Line Option Processing.
Document and give macros for the exit codes of CPROVER binaries.
#define CPROVER_EXIT_INCORRECT_TASK
The command line is correctly structured but cannot be carried out due to missing files,...
Definition exit_codes.h:49
bool parse_json(std::istream &in, const std::string &filename, message_handlert &message_handler, jsont &dest)
std::string banner_string(const std::string &front_end, const std::string &version)
const char * CBMC_VERSION