Skip to content

Commit

Permalink
remove the deprecated "handleHelp" method
Browse files Browse the repository at this point in the history
  • Loading branch information
obra committed Feb 26, 2024
1 parent e114a30 commit bd89266
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,6 @@ EventHandlerResult FocusSerial::onFocusEvent(const char *input) {
return EventHandlerResult::OK;
}

#ifndef NDEPRECATED
bool FocusSerial::handleHelp(const char *input, const char *help_message) {
if (!inputMatchesHelp(input)) return false;

printHelp(help_message);
return true;
}
#endif

void FocusSerial::printBool(bool b) {
Runtime.serialPort().print((b) ? F("true") : F("false"));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@
#include "kaleidoscope/event_handler_result.h" // for EventHandlerResult, EventHandlerResult::OK
#include "kaleidoscope/key_defs.h" // for Key
#include "kaleidoscope/plugin.h" // for Plugin
// -----------------------------------------------------------------------------
// Deprecation warning messages
#include "kaleidoscope_internal/deprecations.h" // for DEPRECATED

#define _DEPRECATED_MESSAGE_FOCUS_HANDLEHELP \
"The `Focus.handleHelp()` method is deprecated. Please use\n" \
"`Focus.inputMatchesHelp()` and `Focus.printHelp()` instead.\n" \
"This method will be removed after 2022-12-26."
// -----------------------------------------------------------------------------

// IWYU pragma: no_include "WString.h"

Expand All @@ -46,11 +37,6 @@ class FocusSerial : public kaleidoscope::Plugin {
static constexpr char SEPARATOR = ' ';
static constexpr char NEWLINE = '\n';

#ifndef NDEPRECATED
DEPRECATED(FOCUS_HANDLEHELP)
bool handleHelp(const char *input, const char *help_message);
#endif

bool inputMatchesHelp(const char *input);
bool inputMatchesCommand(const char *input, const char *expected);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ EventHandlerResult LEDBrightnessConfig::onSetup() {
EventHandlerResult LEDBrightnessConfig::onFocusEvent(const char *command) {
const char *cmd = PSTR("led.brightness");

if (::Focus.handleHelp(command, cmd))
return EventHandlerResult::OK;
if (::Focus.inputMatchesHelp(command))
return ::Focus.printHelp(cmd)

if (strcmp_P(command, cmd) != 0)
return EventHandlerResult::OK;
Expand Down

0 comments on commit bd89266

Please sign in to comment.