logswan

Fast Web log analyzer using probabilistic data structures
Log | Files | Refs | README | LICENSE

commit 365882160b2e66778cef21fa350d7983eaeb50b7
parent d5414cbdc4983e6b6ac0ff69a090e372933b1159
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date:   Sun, 27 Sep 2015 23:32:48 +0200

Creating a 'displayUsage' function to display usage information

Diffstat:
Msrc/logswan.c | 12++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/logswan.c b/src/logswan.c @@ -63,6 +63,13 @@ int getoptFlag; struct HLL uniqueIPv4, uniqueIPv6; +void displayUsage() { + printf("USAGE : logswan [options] inputfile\n\n" \ + "Options are :\n\n" \ + " -h Display usage\n" \ + " -v Display version\n\n"); +} + int main (int argc, char *argv[]) { char *intputFile; @@ -76,10 +83,7 @@ int main (int argc, char *argv[]) { while ((getoptFlag = getopt(argc, argv, "hv")) != -1) { switch(getoptFlag) { case 'h': - printf("USAGE : logswan [-hv] logfile\n\n" \ - "Options are as follow :\n\n" \ - " -h Display usage\n" \ - " -v Display version\n\n"); + displayUsage(); return EXIT_SUCCESS; case 'v':