pvRequest parsing
This commit is contained in:
+7
-1
@@ -25,6 +25,7 @@ void usage(const char* argv0)
|
||||
std::cerr<<"Usage: "<<argv0<<" <opts> <pvname> [ <value> | <fld>=<value> ...]\n"
|
||||
"\n"
|
||||
" -h Show this message.\n"
|
||||
" -r <req> pvRequest condition.\n"
|
||||
" -v Make more noise.\n"
|
||||
" -d Shorthand for $PVXS_LOG=\"pvxs.*=DEBUG\". Make a lot of noise.\n"
|
||||
" -w <sec> Operation timeout in seconds. default 5 sec.\n"
|
||||
@@ -38,10 +39,11 @@ int main(int argc, char *argv[])
|
||||
logger_config_env(); // from $PVXS_LOG
|
||||
double timeout = 5.0;
|
||||
bool verbose = false;
|
||||
std::string request("field()");
|
||||
|
||||
{
|
||||
int opt;
|
||||
while ((opt = getopt(argc, argv, "hvdw:")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "hvdw:r:")) != -1) {
|
||||
switch(opt) {
|
||||
case 'h':
|
||||
usage(argv[0]);
|
||||
@@ -58,6 +60,9 @@ int main(int argc, char *argv[])
|
||||
return 1;
|
||||
}
|
||||
break;
|
||||
case 'r':
|
||||
request = optarg;
|
||||
break;
|
||||
default:
|
||||
usage(argv[0]);
|
||||
std::cerr<<"\nUnknown argument: "<<char(opt)<<std::endl;
|
||||
@@ -105,6 +110,7 @@ int main(int argc, char *argv[])
|
||||
int ret=2;
|
||||
|
||||
auto op =ctxt.put(pvname)
|
||||
.pvRequest(request)
|
||||
.build([&values](Value&& prototype) -> Value {
|
||||
auto val = std::move(prototype);
|
||||
for(auto& pair : values) {
|
||||
|
||||
Reference in New Issue
Block a user