| | |
| | | } |
| | | return false; |
| | | } |
| | | void Apply(std::function<void(const std::string &id, const std::string &desc)> f) const |
| | | void Apply(std::function<void(const std::string &id, const std::string &desc)> const &f) const |
| | | { |
| | | for (auto &kv : functions_) { |
| | | f(kv.second.id_, kv.second.desc_); |
| | |
| | | void Help() |
| | | { |
| | | PrintLn("%s : bhome shared memory message queue box application.", kOrigName.c_str()); |
| | | PrintLn("usage:"); |
| | | PrintLn("%s", "usage:"); |
| | | PrintLn("\t1) %s [function [options]...]", kOrigName.c_str()); |
| | | PrintLn("\t2) rename or link %s to a function name then run it directly.", kOrigName.c_str()); |
| | | PrintLn(); |
| | | PrintLn("supported functions:"); |
| | | PrintLn("%s", "supported functions:"); |
| | | std::map<std::string, std::string> funcs; |
| | | auto getInfo = [&](const std::string &name, const std::string &desc) { |
| | | funcs[name] = desc; |