/** * Copyright - See the COPYRIGHT that is included with this distribution. * pvxs is distributed subject to a Software License Agreement found * in file LICENSE that is included with this distribution. */ #include #include #include #include #include #include #include #include #include #include "utilpvt.h" using namespace pvxs; namespace { void usage(const char* argv0) { std::cerr<<"Usage: "< [pvname ...]\n" "\n" " -h Show this message.\n" " -r pvRequest condition.\n" " -v Make more noise.\n" " -d Shorthand for $PVXS_LOG=\"pvxs.*=DEBUG\". Make a lot of noise.\n" " -w Operation timeout in seconds. default 5 sec.\n" " -# Maximum number of elements to print for each array field.\n" " Set to zero 0 for unlimited.\n" " Default: 20\n" " -F Output format mode: delta, tree\n" ; } } int main(int argc, char *argv[]) { logger_config_env(); // from $PVXS_LOG double timeout = 5.0; bool verbose = false; std::string request; Value::Fmt::format_t format = Value::Fmt::Delta; auto arrLimit = epicsUInt64(-1); { int opt; while ((opt = getopt(argc, argv, "hvdw:r:#:F:")) != -1) { switch(opt) { case 'h': usage(argv[0]); return 0; case 'v': verbose = true; break; case 'd': logger_level_set("pvxs.*", Level::Debug); break; case 'w': if(epicsParseDouble(optarg, &timeout, nullptr)) { std::cerr<<"Invalid timeout value: "<> ops; std::atomic remaining{argc-optind}; epicsEvent done; for(auto n : range(optind, argc)) { ops.push_back(ctxt.get(argv[n]) .pvRequest(request) .result([&argv, n, &remaining, &done, format, arrLimit](client::Result&& result) { std::cout<