Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion pvtoolsSrc/pvget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@ namespace {

size_t pvnamewidth;

bool stringify = false;

int haderror;

void usage (void)
{
fprintf (stderr, "\nUsage: " EXECNAME " [options] <PV name>...\n"
"\n"
COMMON_OPTIONS
" -S: Print array of bytes as a string\n"
" deprecated options:\n"
" -q, -t, -i, -n, -F: ignored\n"
" -f <input file>: errors\n"
Expand Down Expand Up @@ -85,6 +88,7 @@ struct Getter : public pvac::ClientChannel::GetCallback, public Tracker
pvd::PVStructure::Formatter fmt(event.value->stream()
.format(outmode));

fmt.arrayAsString(stringify);
if(verbosity>=2)
fmt.highlight(*event.valid); // show all, highlight valid
else
Expand Down Expand Up @@ -276,7 +280,7 @@ int MAIN (int argc, char *argv[])

// ================ Parse Arguments

while ((opt = getopt(argc, argv, ":hvVRM:r:w:tmp:qdcF:f:ni")) != -1) {
while ((opt = getopt(argc, argv, ":hvVRM:r:w:tmp:qdcF:f:niS")) != -1) {
switch (opt) {
case 'h': /* Print usage */
usage();
Expand Down Expand Up @@ -336,6 +340,9 @@ int MAIN (int argc, char *argv[])
case 'q': /* Quiet mode */
// deprecate
break;
case 'S':
stringify = true; /* Stringify byte scalar arrays */
break;
case 'f': /* Use input stream as input */
fprintf(stderr, "Unsupported option -f\n");
return 1;
Expand Down
Loading