Browse Source

+ void help(int k)

phyto 6 months ago
parent
commit
af0cf9d2e3
2 changed files with 40 additions and 1 deletions
  1. 2
    0
      .gitignore
  2. 38
    1
      storage/t.c

+ 2
- 0
.gitignore View File

@@ -26,6 +26,8 @@ viz/curses/t
26 26
 viz/gnuplot/*.png
27 27
 viz/*.a
28 28
 
29
+storage/t
30
+
29 31
 audio/t
30 32
 audio/*.wav
31 33
 

+ 38
- 1
storage/t.c View File

@@ -1,7 +1,44 @@
1
+/*
2
+ *	phytotron - outil de gestion des datas
3
+ */
4
+
1 5
 #include  <stdio.h>
6
+#include  <stdlib.h>
7
+#include <unistd.h>
8
+
9
+int	verbosity;
10
+
11
+/* --------------------------------------------------------------- */
12
+void help(int k)
13
+{
14
+puts("options : ");
15
+puts("\t-K\tset the K parameter.");
16
+puts("\t-v\tincrease verbosity.");
17
+
18
+exit(0);
19
+}
20
+
21
+/* --------------------------------------------------------------- */
2 22
 
3 23
 int main(int argc, char *argv[])
4 24
 {
5
-fprintf(stderr, "storage tool\n");
25
+int		opt, foo;
26
+int		K = 0;
27
+// char		ligne[100];
28
+
29
+while ((opt = getopt(argc, argv, "hKv")) != -1) {
30
+	switch (opt) {
31
+		case 'h':	help(0);		break;
32
+		case 'K':	K = atoi(optarg);	break;
33
+		case 'v':	verbosity++;		break;
34
+		default:				break;
35
+		}
36
+	}
37
+
38
+fprintf(stderr, "*** storage tool   %s %s\n", __DATE__, __TIME__);
39
+
6 40
 return 0;
7 41
 }
42
+
43
+/* --------------------------------------------------------------- */
44
+

Loading…
Cancel
Save