ongrep

A cleaned up fork of ngrep for OpenBSD
git clone git://git.sgregoratto.me/ongrep
Log | Files | Refs | README | LICENSE

commit 39f982c34853baabeead508be94f0f23cca5bbaf
parent 42c380529ab622e3cbb2a63062ae230e7d70c42b
Author: Stephen Gregoratto <dev@sgregoratto.me>
Date:   Wed, 17 Jun 2020 15:15:51 +1000

Sync usage text with manpage

Diffstat:
Mngrep.c | 40++++------------------------------------
1 file changed, 4 insertions(+), 36 deletions(-)

diff --git a/ngrep.c b/ngrep.c @@ -1195,42 +1195,10 @@ drop_privs(void) void usage(void) { - printf("usage: ngrep <-" - "hNXViwqpevxlDtTRM> <-IO pcap_dump> <-n num> <-d dev> <-A num>\n" - " <-s snaplen> <-S limitlen> <-W normal|byline|single|none> <-c cols>\n" - " <-P char> <-F file>" - "\n" - " <match expression> <bpf filter>\n" - " -h is help/usage\n" - " -V is version information\n" - " -q is be quiet (don't print packet reception hash marks)\n" - " -e is show empty packets\n" - " -i is ignore case\n" - " -v is invert match\n" - " -R is don't do privilege revocation logic\n" - " -x is print in alternate hexdump format\n" - " -X is interpret match expression as hexadecimal\n" - " -w is word-regex (expression must match as a word)\n" - " -p is don't go into promiscuous mode\n" - " -l is make stdout line buffered\n" - " -D is replay pcap_dumps with their recorded time intervals\n" - " -t is print timestamp every time a packet is matched\n" - " -T is print delta timestamp every time a packet is matched\n" - " specify twice for delta from first match\n" - " -M is don't do multi-line match (do single-line match instead)\n" - " -I is read packet stream from pcap format file pcap_dump\n" - " -O is dump matched packets in pcap format to pcap_dump\n" - " -n is look at only num packets\n" - " -A is dump num packets after a match\n" - " -s is set the bpf caplen\n" - " -S is set the limitlen on matched packets\n" - " -W is set the dump format (normal, byline, single, none)\n" - " -c is force the column width to the specified size\n" - " -P is set the non-printable display char to what is specified\n" - " -F is read the bpf filter from the specified file\n" - " -N is show sub protocol number\n" - " -d is use specified device instead of the pcap default\n" - ""); + fprintf(stderr, + "usage: ngrep [-DeilMNpqtTvwxX] [-A num] [-c cols] [-d dev] [-F file] [-I pcap_dump]\n" + " [-n num] [-O pcap_dump] [-P char] [-S limitlen] [-s snaplen]\n" + " [-W normal | byline | single | none] [expression] [filter]\n"); exit(2); }