diff options
-rw-r--r-- | CMakeLists.txt | 1 | ||||
-rw-r--r-- | sample_client/CMakeLists.txt | 7 | ||||
-rw-r--r-- | sample_client/src/client.cpp | 52 |
3 files changed, 0 insertions, 60 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 4116485..68ff6e1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,4 +9,3 @@ find_package(rpclib 2 REQUIRED) add_subdirectory(common) add_subdirectory(daemon) add_subdirectory(library) -add_subdirectory(sample_client) diff --git a/sample_client/CMakeLists.txt b/sample_client/CMakeLists.txt deleted file mode 100644 index c6166fd..0000000 --- a/sample_client/CMakeLists.txt +++ /dev/null @@ -1,7 +0,0 @@ -project(sample_client CXX) -add_executable(${PROJECT_NAME} - src/client.cpp - ) -target_link_libraries(${PROJECT_NAME} - PRIVATE library - ) diff --git a/sample_client/src/client.cpp b/sample_client/src/client.cpp deleted file mode 100644 index c0125c2..0000000 --- a/sample_client/src/client.cpp +++ /dev/null @@ -1,52 +0,0 @@ -#include <cstdlib> -#include <iostream> -#include <stdexcept> -#include <string_view> - -#include <hwd.h> - -int main(int argc, char ** argv) -{ - if (2 > argc) - { - std::cerr << "missing operation" << std::endl; - return 1; - } - std::string_view op {argv[1]}; - if (0 == op.compare("shutdown")) - { - hwd::stop_server(); - } - else if (0 == op.compare("set")) - { - if (3 > argc) - { - std::cerr << "missing int argument to set" << std::endl; - return 1; - } - std::string input {argv[2]}; - try - { - hwd::set_value(std::stoi(input)); - } - catch (const std::invalid_argument &) - { - std::cerr << "bad argument to set" << std::endl; - return 1; - } - catch (const std::out_of_range &) - { - std::cerr << "int argument is too large" << std::endl; - return 1; - } - } - else if (0 == op.compare("get")) - { - std::cout << hwd::get_value() << std::endl; - } - else - { - std::cerr << "invalid operation" << std::endl; - return 1; - } -} |