#pragma once #include class Args { private: String *str; public: Args(String *str) : str(str) {} String operator[](int pos) { char buf[64]; strncpy(buf, str->c_str(), sizeof(buf)); char *args = strtok(buf, " "); while (pos > 0 && args != NULL) { args = strtok(NULL, " "); pos--; } if (args == NULL) { return String(); } return String(args); } }; struct CommandList; struct Command { using Executor = std::function; Executor func; const char* name = NULL; Command(); Command(const char* name, Executor func) : name(name), func(func) {} };