mirror of
https://github.com/okalachev/flix.git
synced 2025-07-27 01:29:33 +00:00
Make cli command case insensitive
iOS QGC capitalizes the command by default, so it's more convinient
This commit is contained in:
parent
df2b10acd4
commit
2bcab6edb3
@ -78,6 +78,8 @@ void doCommand(String str, bool echo = false) {
|
||||
print("> %s\n", str.c_str());
|
||||
}
|
||||
|
||||
command.toLowerCase();
|
||||
|
||||
// execute command
|
||||
if (command == "help" || command == "motd") {
|
||||
print("%s\n", motd);
|
||||
|
@ -52,6 +52,10 @@ public:
|
||||
this->erase(0, this->find_first_not_of(" \t\n\r"));
|
||||
this->erase(this->find_last_not_of(" \t\n\r") + 1);
|
||||
}
|
||||
void toLowerCase() {
|
||||
std::transform(this->begin(), this->end(), this->begin(),
|
||||
[](unsigned char c) { return std::tolower(c); });
|
||||
}
|
||||
};
|
||||
|
||||
class Print;
|
||||
|
Loading…
x
Reference in New Issue
Block a user