Package: didiwiki / 0.5-13

70_usage.patch Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
From: Ignace Mouzannar <mouzannar@gmail.com>
Subject: Usage() function implementation

diff -urNad didiwiki-0.5~/src/didi.c didiwiki-0.5/src/didi.c
--- didiwiki-0.5~/src/didi.c	2009-07-23 17:38:44.000000000 +0200
+++ didiwiki-0.5/src/didi.c	2009-07-23 17:39:32.000000000 +0200
@@ -2,10 +2,16 @@
 
 static int debug;
 
-void 
-usage(char *progname)
-{
-  fprintf(stderr, "usage..\n");
+int
+usage()
+{ 
+  fprintf(stderr, "Usage: didiwiki [options]\n");
+  fprintf(stderr, "   -d, --debug           : debug mode, listens to requests from stdin\n");
+  fprintf(stderr, "   -h, --home   <path>   : specify didiwiki's home directory\n");
+  fprintf(stderr, "   -l, --listen <ipaddr> : specify IP address\n");
+  fprintf(stderr, "   -p, --port   <port>   : specify port number \n");
+  fprintf(stderr, "       --help            : display this help message\n");
+  exit(1);
 }
 
 int 
@@ -31,6 +37,7 @@
       {"listen", required_argument, 0, 'l'},
 	  {"port",   required_argument, 0, 'p'},
 	  {"home",   required_argument, 0, 'h'},
+      {"help",   no_argument,       0,  10 },
 	  {0, 0, 0, 0}
 	};
 
@@ -67,9 +74,13 @@
       } else
         address.s_addr = inet_addr(optarg);
       break;
-      
+
+    case 10:
+      usage();
+      break;
+
 	default:
-	  abort ();
+	  usage();
 	}
     }