Loading README.md +24 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,30 @@ Examples The following examples are provided for development reference and as utilities to aid development In order to execute a given example, execute `kinetic-c` with a given example name and optional arguments (below) First, `cd` into the `build/release` folder, and then execute the desired command. If no command is specified, kinetic-c will execute all of the example commands. **e.g.** - Execute the NoOp operation against default host: `localhost`: ``` cd build/release kinetic-c noop ``` **e.g.** - Execute the NoOp operation against `my-kinetic-server.com`: ``` cd build/release kinetic-c noop --host my-kinetic-server.com ``` `noop [--hostname|-h "some_host.com"|123.253.253.23]` `read_file_blocking` (incomplete!) `read_file_nonblocking` (incomplete!) Loading src/utility/main.c +54 −18 Original line number Diff line number Diff line Loading @@ -32,18 +32,53 @@ int main(int argc, char** argv) const int64_t clusterVersion = 0; const int64_t identity = 1; const char* key = "asdfasdf"; bool doNoOp = false; bool argumentError = true; // Parse command line arguments, if supplied if (argc >= 3) if (argc == 1) { // Simple parser for --host <ip/hostname> for now if ((strcmp("--host", argv[1]) == 0) || (strcmp("--host", argv[1]) == 0)) doNoOp = true; argumentError = false; } else if (argc == 2) { if (strcmp("noop", argv[1]) == 0) { doNoOp = true; argumentError = false; } } else if (argc == 3) { if ((strcmp("--host", argv[1]) == 0) || (strcmp("-h", argv[1]) == 0)) { strcpy(host, argv[2]); doNoOp = true; argumentError = false; } } else if (argc > 3) { // Simple parser for --host <ip/hostname> for now if ((strcmp("noop", argv[1]) == 0) && ((strcmp("--host", argv[2]) == 0) || (strcmp("-h", argv[2]) == 0))) { strcpy(host, argv[3]); doNoOp = true; argumentError = false; } } // Abort unless arguments were invalid! if (argumentError) { printf("\nInvalid arguments specified!\n"); return -1; } if (doNoOp) { printf("\n" "Executing NoOp w/configuration:\n" "-------------------------------\n" Loading @@ -62,6 +97,7 @@ int main(int argc, char** argv) { printf("\nNoOp operation failed! status=%d\n\n", status); } } return status; } Loading
README.md +24 −0 Original line number Diff line number Diff line Loading @@ -67,6 +67,30 @@ Examples The following examples are provided for development reference and as utilities to aid development In order to execute a given example, execute `kinetic-c` with a given example name and optional arguments (below) First, `cd` into the `build/release` folder, and then execute the desired command. If no command is specified, kinetic-c will execute all of the example commands. **e.g.** - Execute the NoOp operation against default host: `localhost`: ``` cd build/release kinetic-c noop ``` **e.g.** - Execute the NoOp operation against `my-kinetic-server.com`: ``` cd build/release kinetic-c noop --host my-kinetic-server.com ``` `noop [--hostname|-h "some_host.com"|123.253.253.23]` `read_file_blocking` (incomplete!) `read_file_nonblocking` (incomplete!) Loading
src/utility/main.c +54 −18 Original line number Diff line number Diff line Loading @@ -32,18 +32,53 @@ int main(int argc, char** argv) const int64_t clusterVersion = 0; const int64_t identity = 1; const char* key = "asdfasdf"; bool doNoOp = false; bool argumentError = true; // Parse command line arguments, if supplied if (argc >= 3) if (argc == 1) { // Simple parser for --host <ip/hostname> for now if ((strcmp("--host", argv[1]) == 0) || (strcmp("--host", argv[1]) == 0)) doNoOp = true; argumentError = false; } else if (argc == 2) { if (strcmp("noop", argv[1]) == 0) { doNoOp = true; argumentError = false; } } else if (argc == 3) { if ((strcmp("--host", argv[1]) == 0) || (strcmp("-h", argv[1]) == 0)) { strcpy(host, argv[2]); doNoOp = true; argumentError = false; } } else if (argc > 3) { // Simple parser for --host <ip/hostname> for now if ((strcmp("noop", argv[1]) == 0) && ((strcmp("--host", argv[2]) == 0) || (strcmp("-h", argv[2]) == 0))) { strcpy(host, argv[3]); doNoOp = true; argumentError = false; } } // Abort unless arguments were invalid! if (argumentError) { printf("\nInvalid arguments specified!\n"); return -1; } if (doNoOp) { printf("\n" "Executing NoOp w/configuration:\n" "-------------------------------\n" Loading @@ -62,6 +97,7 @@ int main(int argc, char** argv) { printf("\nNoOp operation failed! status=%d\n\n", status); } } return status; }