Skip to content

Commit 5b2ddf2

Browse files
committed
add: [pibs] added local usage instructions accessible with -h switch
1 parent 8898555 commit 5b2ddf2

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

bin/pibs.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@
2020
*/
2121
#include "pibs.h"
2222

23+
void usage(void)
24+
{
25+
printf("Usage: pibs [OPTION] ...\n");
26+
printf("Identify backscatter in pacp files\n");
27+
printf("\nOPTIONS\n");
28+
printf("\n -n Create new shared memory segment data structure\n");
29+
printf("\n -i Write shared segment identifier in a file.\n");
30+
printf(" This option must be used in conjuntion with -n option\n");
31+
printf(" -r read pcap files and identity potential backscatter traffic\n");
32+
printf(" -b Show potential backscatter on stdout. The be used in conjuntion with -r\n");
33+
}
34+
2335
int main(int argc, char* argv[])
2436
{
2537

@@ -30,7 +42,7 @@ int main(int argc, char* argv[])
3042

3143
fprintf(stderr, "[INFO] pid = %d\n",(int)getpid());
3244

33-
while ((opt = getopt(argc, argv, "r:dbsni:au:z:p:w:y:")) != -1) {
45+
while ((opt = getopt(argc, argv, "r:dbsni:au:z:p:w:y:h")) != -1) {
3446
switch (opt) {
3547
case 'r':
3648
strncpy(pibs->filename, optarg, FILENAME_MAX);
@@ -69,7 +81,9 @@ int main(int argc, char* argv[])
6981
case 'y':
7082
pibs->redisdb = atoi(optarg);
7183
break;
72-
84+
case 'h':
85+
usage();
86+
break;
7387
default: /* '?' */
7488

7589
fprintf(stderr, "[ERROR] Invalid command line was specified\n");

0 commit comments

Comments
 (0)