Skip to content

Commit

Permalink
add: [pibs] added local usage instructions accessible with -h switch
Browse files Browse the repository at this point in the history
  • Loading branch information
haegardev committed Sep 18, 2019
1 parent 8898555 commit 5b2ddf2
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions bin/pibs.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,18 @@
*/
#include "pibs.h"

void usage(void)
{
printf("Usage: pibs [OPTION] ...\n");
printf("Identify backscatter in pacp files\n");
printf("\nOPTIONS\n");
printf("\n -n Create new shared memory segment data structure\n");
printf("\n -i Write shared segment identifier in a file.\n");
printf(" This option must be used in conjuntion with -n option\n");
printf(" -r read pcap files and identity potential backscatter traffic\n");
printf(" -b Show potential backscatter on stdout. The be used in conjuntion with -r\n");
}

int main(int argc, char* argv[])
{

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

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

while ((opt = getopt(argc, argv, "r:dbsni:au:z:p:w:y:")) != -1) {
while ((opt = getopt(argc, argv, "r:dbsni:au:z:p:w:y:h")) != -1) {
switch (opt) {
case 'r':
strncpy(pibs->filename, optarg, FILENAME_MAX);
Expand Down Expand Up @@ -69,7 +81,9 @@ int main(int argc, char* argv[])
case 'y':
pibs->redisdb = atoi(optarg);
break;

case 'h':
usage();
break;
default: /* '?' */

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

0 comments on commit 5b2ddf2

Please sign in to comment.