diff options
author | Martin Braun <martin.braun@ettus.com> | 2016-09-23 12:00:18 -0700 |
---|---|---|
committer | Martin Braun <martin.braun@ettus.com> | 2016-09-23 12:00:18 -0700 |
commit | 96d16901e27ff653119d52823cfe4feb7a282aff (patch) | |
tree | 44d56b4b347322c1b152569e382b9cfb7f67960b /host | |
parent | a0ceeddc497188a8cce7e45ba5c7473636073247 (diff) | |
download | uhd-96d16901e27ff653119d52823cfe4feb7a282aff.tar.gz uhd-96d16901e27ff653119d52823cfe4feb7a282aff.tar.bz2 uhd-96d16901e27ff653119d52823cfe4feb7a282aff.zip |
utils: uhd_usrp_probe can query vector<string>
Diffstat (limited to 'host')
-rw-r--r-- | host/utils/uhd_usrp_probe.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/host/utils/uhd_usrp_probe.cpp b/host/utils/uhd_usrp_probe.cpp index 49e00d53a..5fc407bfa 100644 --- a/host/utils/uhd_usrp_probe.cpp +++ b/host/utils/uhd_usrp_probe.cpp @@ -228,6 +228,7 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ ("int", po::value<std::string>(), "query a integer value from the property tree") ("sensor", po::value<std::string>(), "query a sensor value from the property tree") ("range", po::value<std::string>(), "query a range (gain, bandwidth, frequency, ...) from the property tree") + ("vector", "when querying a string, interpret that as std::vector") ("init-only", "skip all queries, only initialize device") ; @@ -250,7 +251,16 @@ int UHD_SAFE_MAIN(int argc, char *argv[]){ property_tree::sptr tree = dev->get_tree(); if (vm.count("string")){ - std::cout << tree->access<std::string>(vm["string"].as<std::string>()).get() << std::endl; + if (vm.count("vector")) { + std::vector<std::string> str_vector = tree->access< std::vector<std::string> >(vm["string"].as<std::string>()).get(); + std::cout << "("; + BOOST_FOREACH(const std::string &str, str_vector) { + std::cout << str << ","; + } + std::cout << ")" << std::endl; + } else { + std::cout << tree->access<std::string>(vm["string"].as<std::string>()).get() << std::endl; + } return EXIT_SUCCESS; } |