summaryrefslogtreecommitdiff
path: root/monitor/main.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2018-06-16 21:18:47 +0200
committerMarcel Holtmann <marcel@holtmann.org>2018-06-16 21:22:49 +0200
commit086dc1f315832125303f947b60b2fa9c7464e4ad (patch)
treed8baccac7d222d14493610ff1ce55197399b8684 /monitor/main.c
parent0a7e778a2294a5d4dc7eceaf374a96236fb63ca5 (diff)
downloadbluez-086dc1f315832125303f947b60b2fa9c7464e4ad.tar.gz
monitor: Fix command parameter ordering
Diffstat (limited to 'monitor/main.c')
-rw-r--r--monitor/main.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/monitor/main.c b/monitor/main.c
index 806ab7e3c..c4204f4fd 100644
--- a/monitor/main.c
+++ b/monitor/main.c
@@ -77,14 +77,14 @@ static void usage(void)
}
static const struct option main_options[] = {
- { "tty", required_argument, NULL, 'd' },
- { "tty-speed", required_argument, NULL, 'B' },
{ "read", required_argument, NULL, 'r' },
{ "write", required_argument, NULL, 'w' },
{ "analyze", required_argument, NULL, 'a' },
{ "server", required_argument, NULL, 's' },
{ "priority", required_argument, NULL, 'p' },
{ "index", required_argument, NULL, 'i' },
+ { "tty", required_argument, NULL, 'd' },
+ { "tty-speed", required_argument, NULL, 'B' },
{ "time", no_argument, NULL, 't' },
{ "date", no_argument, NULL, 'T' },
{ "sco", no_argument, NULL, 'S' },
@@ -120,22 +120,12 @@ int main(int argc, char *argv[])
int opt;
struct sockaddr_un addr;
- opt = getopt_long(argc, argv, "d:r:w:a:s:p:i:tTSAEP:vh",
+ opt = getopt_long(argc, argv, "r:w:a:s:p:i:d:B:tTSAEPvh",
main_options, NULL);
if (opt < 0)
break;
switch (opt) {
- case 'd':
- tty= optarg;
- break;
- case 'B':
- tty_speed = tty_get_speed(atoi(optarg));
- if (!tty_speed) {
- fprintf(stderr, "Unknown speed: %s\n", optarg);
- return EXIT_FAILURE;
- }
- break;
case 'r':
reader_path = optarg;
break;
@@ -166,6 +156,16 @@ int main(int argc, char *argv[])
}
packet_select_index(atoi(str));
break;
+ case 'd':
+ tty = optarg;
+ break;
+ case 'B':
+ tty_speed = tty_get_speed(atoi(optarg));
+ if (!tty_speed) {
+ fprintf(stderr, "Unknown speed: %s\n", optarg);
+ return EXIT_FAILURE;
+ }
+ break;
case 't':
filter_mask &= ~PACKET_FILTER_SHOW_TIME_OFFSET;
filter_mask |= PACKET_FILTER_SHOW_TIME;