Skip to content

Commit 857b5f8

Browse files
committed
feat: add documentation and -l switch for 'query'
1 parent fb67900 commit 857b5f8

File tree

1 file changed

+14
-2
lines changed
  • backend/balboa-backend-console

1 file changed

+14
-2
lines changed

backend/balboa-backend-console/main.c

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// balboa
2-
// Copyright (c) 2019, 2020, DCSO GmbH
2+
// Copyright (c) 2019, 2026, DCSO GmbH
33

44
#include <arpa/inet.h>
55
#include <assert.h>
@@ -177,6 +177,7 @@ static int main_query(int argc, char** argv) {
177177
case 'v': trace_config.verbosity += 1; break;
178178
case 'h': engine_config.host = opt.arg; break;
179179
case 'p': engine_config.port = atoi(opt.arg); break;
180+
case 'l': query->limit = atoi(opt.arg); break;
180181
case 'd':
181182
if(opt.arg == NULL) {
182183
L(log_emergency("string for option `-d` required"));
@@ -365,6 +366,17 @@ Command dump:\n\
365366
-v increase verbosity; can be passed multiple times\n\
366367
-d <remote-dump-path> unused/ignored (default: -)\n\
367368
\n\
369+
Command query:\n\
370+
execute a query against the database\n\
371+
\n\
372+
-h <host> ip address of the `balboa-backend` (default: 127.0.0.1)\n\
373+
-p <port> port of the `balboa-backend` (default: 4242)\n\
374+
-r <rrname> rrname to query for\n\
375+
-d <rdata> rdata to query for\n\
376+
-s <sensorid> sensorid to filter by\n\
377+
-l <limit> maximum number of results (default: 100)\n\
378+
-v increase verbosity; can be passed multiple times\n\
379+
\n\
368380
Command replay:\n\
369381
replay a previously generated database dump\n\
370382
\n\
@@ -530,4 +542,4 @@ int main(int argc, char** argv) {
530542
}
531543

532544
return (res);
533-
}
545+
}

0 commit comments

Comments
 (0)