Skip to content

Commit f485715

Browse files
committed
Use primitives.sw.main.
1 parent d383aec commit f485715

4 files changed

Lines changed: 10 additions & 20 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,7 @@ cppan_add_package(
149149
pvt.egorpugin.primitives.pack-master
150150
pvt.egorpugin.primitives.yaml-master
151151
pvt.egorpugin.primitives.win32helpers-master
152+
pvt.egorpugin.primitives.sw.main-master
152153

153154
pvt.egorpugin.primitives.tools.embedder-master
154155

cppan.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ local_settings:
88

99
root_project: pvt.cppan.client
1010

11+
add_directories:
12+
- d:/dev/primitives
13+
1114
common_settings:
1215
c++: 17
1316

@@ -180,5 +183,8 @@ projects:
180183

181184
dependencies:
182185
- common
186+
- name: pvt.egorpugin.primitives.sw.main
187+
version: master
188+
local: primitives.sw.main
183189
- pvt.cppan.demo.boost.program_options: 1
184190
- pvt.cppan.demo.yhirose.cpp_linenoise: master

src/client/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ file(GLOB cppan_src "*.cpp" "*.h" "*.rc")
1010

1111
add_executable(client ${cppan_src})
1212
target_link_libraries(client common
13+
pvt.egorpugin.primitives.sw.main
1314
pvt.cppan.demo.boost.program_options
1415
pvt.cppan.demo.yhirose.cpp_linenoise
1516
)

src/client/main.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include <primitives/templates.h>
4040
#include <primitives/executor.h>
4141
#include <primitives/win32helpers.h>
42+
#include <primitives/sw/main.h>
4243

4344
#include <iostream>
4445
#include <thread>
@@ -63,8 +64,7 @@ void self_upgrade_copy(const path &dst);
6364
optional<int> internal(const Strings &args);
6465
void command_init(const Strings &args);
6566

66-
int main1(int argc, char *argv[])
67-
try
67+
int main(int argc, char *argv[])
6868
{
6969
Strings args;
7070
for (auto i = 0; i < argc; i++)
@@ -470,24 +470,6 @@ try
470470

471471
return 0;
472472
}
473-
catch (const std::exception &e)
474-
{
475-
std::cerr << e.what() << "\n";
476-
//if (auto st = boost::get_error_info<traced_exception>(e))
477-
//std::cerr << *st << '\n';
478-
return 1;
479-
}
480-
catch (...)
481-
{
482-
std::cerr << "Unhandled unknown exception" << "\n";
483-
return 1;
484-
}
485-
486-
int main(int argc, char *argv[])
487-
{
488-
auto r = main1(argc, argv);
489-
return r;
490-
}
491473

492474
void check_spec_file()
493475
{

0 commit comments

Comments
 (0)