summaryrefslogtreecommitdiff
path: root/7ed.c
blob: a2dd4e17e2429565acb831022251fc6f7524e5df (plain)
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
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include "7ed.h"
#include <stdint.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;

}