terminal: context is a temporary

Make sure it could be moved further along, and the values inside of it
can be safely moved as well.

Also fixup commands that were missing ctx in OK / Error.
This commit is contained in:
Maxim Prokhorov
2021-12-08 17:49:16 +03:00
parent a0e090489b
commit 2f580a37a2
32 changed files with 125 additions and 124 deletions

View File

@@ -1257,7 +1257,7 @@ void buttonSetup() {
DEBUG_MSG_P(PSTR("[BUTTON] Number of buttons: %u\n"), count);
#if TERMINAL_SUPPORT
terminalRegisterCommand(F("BUTTON"), [](const terminal::CommandContext& ctx) {
terminalRegisterCommand(F("BUTTON"), [](::terminal::CommandContext&& ctx) {
unsigned index { 0u };
for (auto& button : _buttons) {
ctx.output.printf_P(PSTR("%u - "), index++);