summaryrefslogtreecommitdiff
path: root/monitor/main.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2018-05-24 16:29:50 +0200
committerMarcel Holtmann <marcel@holtmann.org>2018-05-24 16:29:50 +0200
commit98ec05de7647fc6af72fd59f5707d5d0c42acc86 (patch)
tree9d25403d7774a01571cd9a2cfb89f10c2e451f93 /monitor/main.c
parent6e473eba73c2a5cf4f5acde4af12c626bdffe996 (diff)
downloadbluez-98ec05de7647fc6af72fd59f5707d5d0c42acc86.tar.gz
monitor: Add command line option to disable pager support
Diffstat (limited to 'monitor/main.c')
-rw-r--r--monitor/main.c42
1 files changed, 24 insertions, 18 deletions
diff --git a/monitor/main.c b/monitor/main.c
index 3e61a4661..806ab7e3c 100644
--- a/monitor/main.c
+++ b/monitor/main.c
@@ -72,32 +72,35 @@ static void usage(void)
"\t-S, --sco Dump SCO traffic\n"
"\t-A, --a2dp Dump A2DP stream traffic\n"
"\t-E, --ellisys [ip] Send Ellisys HCI Injection\n"
+ "\t-P, --no-pager Disable pager usage\n"
"\t-h, --help Show help options\n");
}
static const struct option main_options[] = {
- { "tty", required_argument, NULL, 'd' },
+ { "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' },
- { "time", no_argument, NULL, 't' },
- { "date", no_argument, NULL, 'T' },
- { "sco", no_argument, NULL, 'S' },
- { "a2dp", no_argument, NULL, 'A' },
- { "ellisys", required_argument, NULL, 'E' },
- { "todo", no_argument, NULL, '#' },
- { "version", no_argument, NULL, 'v' },
- { "help", no_argument, NULL, 'h' },
+ { "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' },
+ { "time", no_argument, NULL, 't' },
+ { "date", no_argument, NULL, 'T' },
+ { "sco", no_argument, NULL, 'S' },
+ { "a2dp", no_argument, NULL, 'A' },
+ { "ellisys", required_argument, NULL, 'E' },
+ { "no-pager", no_argument, NULL, 'P' },
+ { "todo", no_argument, NULL, '#' },
+ { "version", no_argument, NULL, 'v' },
+ { "help", no_argument, NULL, 'h' },
{ }
};
int main(int argc, char *argv[])
{
unsigned long filter_mask = 0;
+ bool use_pager = true;
const char *reader_path = NULL;
const char *writer_path = NULL;
const char *analyze_path = NULL;
@@ -117,8 +120,8 @@ int main(int argc, char *argv[])
int opt;
struct sockaddr_un addr;
- opt = getopt_long(argc, argv, "d:r:w:a:s:p:i:tTSAE:vh",
- main_options, NULL);
+ opt = getopt_long(argc, argv, "d:r:w:a:s:p:i:tTSAEP:vh",
+ main_options, NULL);
if (opt < 0)
break;
@@ -182,6 +185,9 @@ int main(int argc, char *argv[])
ellisys_server = optarg;
ellisys_port = 24352;
break;
+ case 'P':
+ use_pager = false;
+ break;
case '#':
packet_todo();
lmp_todo();
@@ -228,7 +234,7 @@ int main(int argc, char *argv[])
if (ellisys_server)
ellisys_enable(ellisys_server, ellisys_port);
- control_reader(reader_path);
+ control_reader(reader_path, use_pager);
return EXIT_SUCCESS;
}