From 774e5bb6f1ae8d88c00e5b7520e42b8c656f4f4b Mon Sep 17 00:00:00 2001 From: mattbw Date: Sun, 7 Dec 2014 22:03:51 +0000 Subject: [PATCH 1/2] Rename OKAY response to OK. `s/OKAY/OK/g` Fixes #63. Breaks anything that was expecting OKAY; expect OK instead. --- src/cmd_result.cpp | 2 +- src/io/io_response.cpp | 2 +- src/io/io_response.hpp | 2 +- src/tests/cmd_result.cpp | 4 ++-- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/cmd_result.cpp b/src/cmd_result.cpp index 4c047e4..c447bb9 100644 --- a/src/cmd_result.cpp +++ b/src/cmd_result.cpp @@ -14,7 +14,7 @@ #include "cmd_result.hpp" /* static */ const ResponseCode CommandResult::TYPE_CODES[] = { - ResponseCode::OKAY, // Type::SUCCESS + ResponseCode::OK, // Type::SUCCESS ResponseCode::WHAT, // Type::INVALID ResponseCode::FAIL, // Type::FAILURE }; diff --git a/src/io/io_response.cpp b/src/io/io_response.cpp index 9681a10..4fa4a82 100644 --- a/src/io/io_response.cpp +++ b/src/io/io_response.cpp @@ -15,7 +15,7 @@ #include "io_response.hpp" const std::string ResponseSink::STRINGS[] = { - "OKAY", // ResponseCode::OKAY + "OK", // ResponseCode::OK "WHAT", // ResponseCode::WHAT "FAIL", // ResponseCode::FAIL "OHAI", // ResponseCode::OHAI diff --git a/src/io/io_response.hpp b/src/io/io_response.hpp index 05b6d56..3984258 100644 --- a/src/io/io_response.hpp +++ b/src/io/io_response.hpp @@ -24,7 +24,7 @@ * @see ResponseSink::STRINGS */ enum class ResponseCode : std::uint8_t { - OKAY, ///< Request was valid and produced an answer. + OK, ///< Request was valid and produced an answer. WHAT, ///< Request was invalid/user error. FAIL, ///< Error, pointing blame at environment. OHAI, ///< Server starting up. diff --git a/src/tests/cmd_result.cpp b/src/tests/cmd_result.cpp index c94a0ac..ce2f669 100644 --- a/src/tests/cmd_result.cpp +++ b/src/tests/cmd_result.cpp @@ -33,8 +33,8 @@ SCENARIO("CommandResult's convenience constructors create correct CommandResults WHEN("Emit(cmd) is called") { c.Emit(d, cmd); - THEN("the response is OKAY followed by the command words") { - REQUIRE(os.str() == "OKAY OHAI 'testy test'\n"); + THEN("the response is OK followed by the command words") { + REQUIRE(os.str() == "OK OHAI 'testy test'\n"); } } } From 01fdc590c3b213e7a02135bc7ac9c2acb5c32961 Mon Sep 17 00:00:00 2001 From: mattbw Date: Sun, 7 Dec 2014 22:15:04 +0000 Subject: [PATCH 2/2] Fix references in comments/docs. --- README.commands.md | 2 +- src/cmd_result.hpp | 2 +- src/playd.1 | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.commands.md b/README.commands.md index ad4dbef..08767b3 100644 --- a/README.commands.md +++ b/README.commands.md @@ -109,7 +109,7 @@ Announces a state change. The _state_ will be one of: Announces that _file_ has just been loaded. -### OKAY _command..._ +### OK _command..._ Announces that a valid _command_ has just been received and processed. diff --git a/src/cmd_result.hpp b/src/cmd_result.hpp index 91268ee..92f461b 100644 --- a/src/cmd_result.hpp +++ b/src/cmd_result.hpp @@ -76,7 +76,7 @@ class CommandResult /** * Sends a response to a ResponseSink about this CommandResult. * - * If the CommandResult was a success, then the response is 'OKAY cmd', + * If the CommandResult was a success, then the response is 'OK cmd', * where 'cmd' is the parameter named as such. Otherwise, the response * is 'X msg', where 'msg' is the result message and 'X' is whichever * response code is most appropriate for the failure. diff --git a/src/playd.1 b/src/playd.1 index dbac390..a4ca94f 100644 --- a/src/playd.1 +++ b/src/playd.1 @@ -183,7 +183,7 @@ Sent upon connection; .Ar ident identifies the playd server and version number. .\" -.It OKAY Ar command... +.It OK Ar command... .Nm just finished processing .Ar command .