diff options
Diffstat (limited to '7ed.c')
-rw-r--r-- | 7ed.c | 19 |
1 files changed, 9 insertions, 10 deletions
@@ -10,30 +10,29 @@ int main (int argc, char *argv[]) { -int opt; -int returnval; -while ((opt = getopt(argc, argv, "i:")) != -1) { + int opt; + int returnval; + while ((opt = getopt(argc, argv, "i:")) != -1) { switch (opt) { - - case 'i': + case 'i': returnval = startmode(optarg); if (returnval == 1) { return EXIT_FAILURE; } - break; + 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_FAILURE; } -return EXIT_SUCCESS; + return EXIT_SUCCESS; }
\ No newline at end of file |