From 45795ba6e39027982e215d1ea4c37ad67c987c04 Mon Sep 17 00:00:00 2001 From: Oskar Date: Thu, 26 Oct 2023 15:59:28 +0200 Subject: First commit --- 7ed.c | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 7ed.c (limited to '7ed.c') diff --git a/7ed.c b/7ed.c new file mode 100644 index 0000000..26b803e --- /dev/null +++ b/7ed.c @@ -0,0 +1,38 @@ +#include +#include +#include +#include +#include "7ed.h" + +#define USAGE "" +#define PROGRAM_NAME "7ed" + +int main (int argc, char *argv[]) { + +int opt; +int returnval; +while ((opt = getopt(argc, argv, "i:")) != -1) { + switch (opt) { + + case 'i': + + returnval = startmode(optarg); + if (returnval == 1) { + return EXIT_FAILURE; + } + break; + + default: + fprintf(stderr, "%s", USAGE); + return EXIT_FAILURE; + } +} + + if (argc == 1) { + fprintf(stderr, "%s: Please provide a file.\n%s", argv[0], USAGE); + return EXIT_FAILURE; + } + +return EXIT_SUCCESS; + +} \ No newline at end of file -- cgit v1.2.3