aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/um/service/utils
diff options
context:
space:
mode:
Diffstat (limited to 'um/service/utils')
-rw-r--r--um/service/utils/install_service.cpp13
-rw-r--r--um/service/utils/start_service.cpp13
-rw-r--r--um/service/utils/stop_service.cpp13
-rw-r--r--um/service/utils/uninstall_service.cpp13
4 files changed, 16 insertions, 36 deletions
diff --git a/um/service/utils/install_service.cpp b/um/service/utils/install_service.cpp
index c452e0d..5af98ef 100644
--- a/um/service/utils/install_service.cpp
+++ b/um/service/utils/install_service.cpp
@@ -8,20 +8,15 @@
#include <exception>
#include <iostream>
-int main(int argc, char* argv[])
-{
- if (argc != 3)
- {
+int main(int argc, char* argv[]) {
+ if (argc != 3) {
std::cout << "Usage: " << argv[0] << " NAME SYS_PATH\n";
return 1;
}
- try
- {
+ try {
service::Service::install(service::ServiceManager::open(), argv[1], argv[2]);
- }
- catch (const std::exception& e)
- {
+ } catch (const std::exception& e) {
std::cerr << e.what() << "\n";
return 1;
}
diff --git a/um/service/utils/start_service.cpp b/um/service/utils/start_service.cpp
index 79c2d24..1743ece 100644
--- a/um/service/utils/start_service.cpp
+++ b/um/service/utils/start_service.cpp
@@ -8,20 +8,15 @@
#include <exception>
#include <iostream>
-int main(int argc, char* argv[])
-{
- if (argc != 2)
- {
+int main(int argc, char* argv[]) {
+ if (argc != 2) {
std::cout << "Usage: " << argv[0] << " NAME\n";
return 1;
}
- try
- {
+ try {
service::Service::open(service::ServiceManager::open(), argv[1]).start();
- }
- catch (const std::exception& e)
- {
+ } catch (const std::exception& e) {
std::cerr << e.what() << "\n";
return 1;
}
diff --git a/um/service/utils/stop_service.cpp b/um/service/utils/stop_service.cpp
index d9ccde9..fcfa67e 100644
--- a/um/service/utils/stop_service.cpp
+++ b/um/service/utils/stop_service.cpp
@@ -8,20 +8,15 @@
#include <exception>
#include <iostream>
-int main(int argc, char* argv[])
-{
- if (argc != 2)
- {
+int main(int argc, char* argv[]) {
+ if (argc != 2) {
std::cout << "Usage: " << argv[0] << " NAME\n";
return 1;
}
- try
- {
+ try {
service::Service::open(service::ServiceManager::open(), argv[1]).stop();
- }
- catch (const std::exception& e)
- {
+ } catch (const std::exception& e) {
std::cerr << e.what() << "\n";
return 1;
}
diff --git a/um/service/utils/uninstall_service.cpp b/um/service/utils/uninstall_service.cpp
index aa5af85..d7c105c 100644
--- a/um/service/utils/uninstall_service.cpp
+++ b/um/service/utils/uninstall_service.cpp
@@ -8,20 +8,15 @@
#include <exception>
#include <iostream>
-int main(int argc, char* argv[])
-{
- if (argc != 2)
- {
+int main(int argc, char* argv[]) {
+ if (argc != 2) {
std::cout << "Usage: " << argv[0] << " NAME\n";
return 1;
}
- try
- {
+ try {
service::Service::open(service::ServiceManager::open(), argv[1]).uninstall();
- }
- catch (const std::exception& e)
- {
+ } catch (const std::exception& e) {
std::cerr << e.what() << "\n";
return 1;
}