projects
/
pulseview.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
DeviceToolButton: Support having no selected device
[pulseview.git]
/
main.cpp
diff --git
a/main.cpp
b/main.cpp
index 74d13fdc4af1b0eeb9e9b3d3e1d64169597b8dd9..285c1535f3c20898307923de6c49ad08bcbfc899 100644
(file)
--- a/
main.cpp
+++ b/
main.cpp
@@
-23,7
+23,7
@@
#endif
#include <stdint.h>
#endif
#include <stdint.h>
-#include <libsigrok
/libsigrok
.hpp>
+#include <libsigrok
cxx/libsigrokcxx
.hpp>
#include <getopt.h>
#include <getopt.h>
@@
-56,9
+56,11
@@
void usage()
" %s [OPTION…] [FILE] — %s\n"
"\n"
"Help Options:\n"
" %s [OPTION…] [FILE] — %s\n"
"\n"
"Help Options:\n"
- " -l, --loglevel Set libsigrok/libsigrokdecode loglevel\n"
- " -V, --version Show release version\n"
" -h, -?, --help Show help option\n"
" -h, -?, --help Show help option\n"
+ "\n"
+ "Application Options:\n"
+ " -V, --version Show release version\n"
+ " -l, --loglevel Set libsigrok/libsigrokdecode loglevel\n"
"\n", PV_BIN_NAME, PV_DESCRIPTION);
}
"\n", PV_BIN_NAME, PV_DESCRIPTION);
}
@@
-78,18
+80,28
@@
int main(int argc, char *argv[])
// Parse arguments
while (1) {
static const struct option long_options[] = {
// Parse arguments
while (1) {
static const struct option long_options[] = {
- {"loglevel", required_argument, 0, 'l'},
- {"version", no_argument, 0, 'V'},
{"help", no_argument, 0, 'h'},
{"help", no_argument, 0, 'h'},
+ {"version", no_argument, 0, 'V'},
+ {"loglevel", required_argument, 0, 'l'},
{0, 0, 0, 0}
};
const int c = getopt_long(argc, argv,
{0, 0, 0, 0}
};
const int c = getopt_long(argc, argv,
- "l:Vh?", long_options,
NULL
);
+ "l:Vh?", long_options,
nullptr
);
if (c == -1)
break;
switch (c) {
if (c == -1)
break;
switch (c) {
+ case 'h':
+ case '?':
+ usage();
+ return 0;
+
+ case 'V':
+ // Print version info
+ fprintf(stdout, "%s %s\n", PV_TITLE, PV_VERSION_STRING);
+ return 0;
+
case 'l':
{
const int loglevel = atoi(optarg);
case 'l':
{
const int loglevel = atoi(optarg);
@@
-101,16
+113,6
@@
int main(int argc, char *argv[])
break;
}
break;
}
-
- case 'V':
- // Print version info
- fprintf(stdout, "%s %s\n", PV_TITLE, PV_VERSION_STRING);
- return 0;
-
- case 'h':
- case '?':
- usage();
- return 0;
}
}
}
}
@@
-127,7
+129,7
@@
int main(int argc, char *argv[])
#ifdef ENABLE_DECODE
// Initialise libsigrokdecode
#ifdef ENABLE_DECODE
// Initialise libsigrokdecode
- if (srd_init(
NULL
) != SRD_OK) {
+ if (srd_init(
nullptr
) != SRD_OK) {
qDebug() << "ERROR: libsigrokdecode init failed.";
break;
}
qDebug() << "ERROR: libsigrokdecode init failed.";
break;
}