diff options
author | Oskar <[email protected]> | 2023-10-26 15:59:28 +0200 |
---|---|---|
committer | Oskar <[email protected]> | 2023-10-26 15:59:28 +0200 |
commit | 45795ba6e39027982e215d1ea4c37ad67c987c04 (patch) | |
tree | 6b36b9d8fe5d0708df7096ef1a2f4e31cb0f7c75 /7ed.c |
First commit
Diffstat (limited to '7ed.c')
-rw-r--r-- | 7ed.c | 38 |
1 files changed, 38 insertions, 0 deletions
@@ -0,0 +1,38 @@ +#include <stdlib.h> +#include <stdio.h> +#include <unistd.h> +#include <string.h> +#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 |