File tree Expand file tree Collapse file tree 2 files changed +10
-9
lines changed
Expand file tree Collapse file tree 2 files changed +10
-9
lines changed Original file line number Diff line number Diff line change @@ -110,6 +110,9 @@ projects:
110110 - name : pvt.egorpugin.primitives.context
111111 version : master
112112 local : primitives.context
113+ - name : pvt.egorpugin.primitives.sw.main
114+ version : master
115+ local : primitives.sw.main
113116 - pvt.cppan.demo.sqlite3 : 3
114117
115118 client :
Original file line number Diff line number Diff line change 1717#include < boost/algorithm/string.hpp>
1818#include < primitives/context.h>
1919#include < primitives/filesystem.h>
20+ #include < primitives/sw/main.h>
21+ #include < primitives/sw/settings.h>
2022#include < sqlite3.h>
2123
2224#include < functional>
@@ -32,7 +34,7 @@ sqlite3 *db;
3234String INCLUDE = " sqlpp11" ;
3335String NAMESPACE = " sqlpp" ;
3436
35- StringMap types{
37+ StringMap<String> types{
3638 {
3739 " integer" ,
3840 " integer" ,
@@ -131,15 +133,11 @@ auto escape_if_reserved(const String &name)
131133
132134int main (int argc, char **argv)
133135{
134- if (argc != 4 )
135- {
136- std::cerr << " sqlite2cpp sql_script output_file namespace" ;
137- return 1 ;
138- }
136+ cl::opt<path> ddl (cl::Positional, cl::desc (" <input sql script>" ), cl::Required);
137+ cl::opt<path> target (cl::Positional, cl::desc (" <output .cpp file>" ), cl::Required);
138+ cl::opt<std::string> ns (cl::Positional, cl::desc (" <namespace>" ), cl::Required);
139139
140- String ddl = argv[1 ];
141- String target = argv[2 ];
142- String ns = argv[3 ];
140+ cl::parseCommandLineOptions (argc, argv);
143141
144142 sqlite3_open (" :memory:" , &db);
145143 execute (read_file (ddl).c_str ());
You can’t perform that action at this time.
0 commit comments