14 static int joedbi(Arguments &arguments)
17 Parsed_Logger logger(arguments);
19 const Record_Id max_record_id
21 arguments.get_option<
index_t>(
"max_record_id",
"n", -1)
24 arguments.add_parameter(
"<file>");
26 const bool default_only =
false;
27 const bool include_shared =
false;
29 File_Parser file_parser
36 Abstract_File *file = file_parser.parse(logger.get(), arguments);
40 arguments.print_help(std::cerr) <<
'\n';
41 file_parser.print_help(std::cerr);
45 Blob_Reader_Command_Processor blob_processor(*file);
47 if (file->is_readonly())
49 Database db(max_record_id);
50 Readonly_Journal journal(*file);
51 journal.replay_log(db);
52 Readable_Interpreter interpreter(db);
53 interpreter.add_processor(blob_processor);
54 interpreter.main_loop(std::cin, std::cout);
58 Writable_Database_Client client
66 client.transaction([max_record_id, &blob_processor]
68 const Readable &readable,
72 Interpreter interpreter(readable, writable, max_record_id);
73 interpreter.add_processor(blob_processor);
74 interpreter.main_loop(std::cin, std::cout);
83int main(
int argc,
char **argv)
static Connection dummy
Since this class has no internal state, this global variable can be used instead of creating an insta...
@ write_existing_or_create_new
either write_existing or create_new depending on whether the file exists. Racy in Posix,...
int main_wrapper(int(*main)(Arguments &), int argc, char **argv)
Process command-line arguments and catch exceptions from main.