36 #ifndef RCDISCOVER_CLI_UTILS_H 37 #define RCDISCOVER_CLI_UTILS_H 47 std::vector<std::string>
name = {};
48 std::vector<std::string>
serial = {};
49 std::vector<std::string>
mac = {};
50 std::vector<std::string>
iface = {};
51 std::vector<std::string>
model = {};
63 const std::vector<std::vector<std::string>> &to_be_printed);
66 const std::vector<rcdiscover::DeviceInfo> &devices,
67 bool print_header,
bool iponly,
bool serialonly);
69 template<
typename K,
typename V>
73 for (
const auto &cmd : commands)
75 max_size = std::max(max_size, static_cast<int>(cmd.first.length()));
80 #endif //RCDISCOVER_CLI_UTILS_H int parseFilterArguments(int argc, char **argv, DeviceFilter &filter)
std::vector< std::string > serial
std::vector< std::string > name
int getMaxCommandLen(const std::map< K, V > &commands)
std::vector< std::string > model
bool filterDevice(const rcdiscover::DeviceInfo &device_info, const DeviceFilter &filter)
std::vector< rcdiscover::DeviceInfo > discoverWithFilter(const DeviceFilter &filter)
std::vector< std::string > iface
std::vector< std::string > mac
void printDeviceTable(std::ostream &oss, const std::vector< rcdiscover::DeviceInfo > &devices, bool print_header, bool iponly, bool serialonly)
void printTable(std::ostream &oss, const std::vector< std::vector< std::string >> &to_be_printed)
static const std::map< std::string, Command > commands