commit 06f4fa2437972102f32c44c028394afa089f948c
parent f4ab3912e2106c735b6bc7e04443c7ddfe2ea58d
Author: Frederic Cambus <fcambus@users.sourceforge.net>
Date: Thu, 3 Sep 2015 23:39:26 +0200
Do not use '-i' option anymore to specify input file name, use optind instead
Diffstat:
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/src/logswan.c b/src/logswan.c
@@ -73,25 +73,19 @@ int main (int argc, char *argv[]) {
" Logswan (c) by Frederic Cambus 2015 \n" \
"-------------------------------------------------------------------------------\n\n");
- while ((getoptFlag = getopt(argc, argv, "i:v")) != -1) {
+ while ((getoptFlag = getopt(argc, argv, "v")) != -1) {
switch(getoptFlag) {
- case 'i':
- intputFile = optarg;
- break;
case 'v':
printf("%s\n", VERSION);
return EXIT_SUCCESS;
}
}
+
+ intputFile = argv[optind];
argc -= optind;
argv += optind;
- if (!intputFile) {
- printf("ERROR : No input file specified.\n");
- return EXIT_FAILURE;
- }
-
/* Starting timer */
begin = clock();