1
0
Fork 0
mirror of https://github.com/ton-blockchain/ton synced 2025-03-09 15:40:10 +00:00

Improve readability of validator-engine-console commands (#1426)

1. Add dashes to command names (old names still work for compatibility)
2. Better shard format
3. Allow base64 in some parameters
This commit is contained in:
SpyCheese 2024-12-11 14:48:48 +03:00 committed by GitHub
parent 540d1fb4b7
commit ce58805104
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 193 additions and 155 deletions

View file

@ -206,9 +206,8 @@ void ValidatorEngineConsole::show_help(std::string command, td::Promise<td::Buff
td::TerminalIO::out() << cmd.second->help() << "\n";
}
} else {
auto it = query_runners_.find(command);
if (it != query_runners_.end()) {
td::TerminalIO::out() << it->second->help() << "\n";
if (auto query = get_query(command)) {
td::TerminalIO::out() << query->help() << "\n";
} else {
td::TerminalIO::out() << "unknown command '" << command << "'\n";
}
@ -232,10 +231,9 @@ void ValidatorEngineConsole::parse_line(td::BufferSlice data) {
}
auto name = tokenizer.get_token<std::string>().move_as_ok();
auto it = query_runners_.find(name);
if (it != query_runners_.end()) {
if (auto query = get_query(name)) {
running_queries_++;
it->second->run(actor_id(this), std::move(tokenizer));
query->run(actor_id(this), std::move(tokenizer));
} else {
td::TerminalIO::out() << "unknown command '" << name << "'\n";
}