diff --git a/sdks/c/CMakeLists.txt b/sdks/c/CMakeLists.txt index 56186c6..8e0d483 100644 --- a/sdks/c/CMakeLists.txt +++ b/sdks/c/CMakeLists.txt @@ -7,7 +7,7 @@ add_executable(${PROJECT_NAME} example.c) set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 23) find_package(PkgConfig REQUIRED) -pkg_check_modules(libcurl REQUIRED IMPORTED_TARGET libcurl>=7.17.0) +pkg_check_modules(libcurl REQUIRED IMPORTED_TARGET libcurl>=8.5.0) add_subdirectory(libMemoryKV) diff --git a/sdks/c/example.c b/sdks/c/example.c index daaf8f5..072d391 100644 --- a/sdks/c/example.c +++ b/sdks/c/example.c @@ -15,10 +15,17 @@ void print_memkv_result(memkv_result *response) { free(response); } -int main(void) { +int main(int argc, char **argv) { + memkv_client *client; - client = memkv_client_new("http://localhost:8080"); + static char defalt_address[] = "http://localhost:8080"; + + if (argc == 1) { + client = memkv_client_new(argv[1]); + } else { + client = memkv_client_new(defalt_address); + } memkv_result *response;