]> infiniteadaptability.org Git - git-extra/commitdiff
initial project creation
authoralex <[email protected]>
Fri, 11 Sep 2020 07:02:02 +0000 (08:02 +0100)
committeralex <[email protected]>
Fri, 11 Sep 2020 07:04:08 +0000 (08:04 +0100)
Dockerfile [new file with mode: 0644]
README.md [new file with mode: 0644]
include/main.h [new file with mode: 0644]
src/main.c [new file with mode: 0644]

diff --git a/Dockerfile b/Dockerfile
new file mode 100644 (file)
index 0000000..8829d17
--- /dev/null
@@ -0,0 +1,9 @@
+FROM debian:latest
+
+RUN apt-get update
+RUN apt-get install -y autoconf automake gcc make
+
+WORKDIR /bugs
+
+COPY include include/
+COPY src src/
\ No newline at end of file
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..6602990
--- /dev/null
+++ b/README.md
@@ -0,0 +1,3 @@
+# Bug Tracker
+
+Git-integrated bug tracker.
\ No newline at end of file
diff --git a/include/main.h b/include/main.h
new file mode 100644 (file)
index 0000000..faa8bd0
--- /dev/null
@@ -0,0 +1,11 @@
+#ifndef __MAIN_H_
+
+#include<stdio.h>
+#include<stdlib.h>
+#include<getopt.h>
+
+extern int verbose_flag;
+
+int main(int,char**);
+
+#endif
\ No newline at end of file
diff --git a/src/main.c b/src/main.c
new file mode 100644 (file)
index 0000000..f482170
--- /dev/null
@@ -0,0 +1,40 @@
+#include<main.h>
+
+int verbose_flag;
+
+static struct option long_options[] = {
+       {"verbose", no_argument, &verbose_flag, 1},
+       {"quiet", no_argument, &verbose_flag, 0},
+       {0,0,0,0}
+};
+
+int main(int argc, char **argv) {
+       int c;
+
+       while(1) {
+               int option_index = 0;
+
+               if((c = getopt_long(argc,argv,"vq",long_options,&option_index))==-1) { break; }
+
+               switch(c) {
+                       case 0:
+                               if(long_options[option_index].flag!=0) { break; }
+
+                               printf("option %s",long_options[option_index].name);
+                               if(optarg) {
+                                       printf(" with arg %s",optarg);
+                               }
+                               printf("\n");
+                               
+                               break;
+                       case '?':
+                               break;
+                       default:
+                               return EXIT_FAILURE;
+               }
+       }
+
+       printf("verbose flag set\n");
+
+       return EXIT_SUCCESS;
+}
\ No newline at end of file