From 41d79f8ee679471ea591e7cb6c33ccad5c856d69 Mon Sep 17 00:00:00 2001 From: Timo Kokkonen Date: Mon, 19 Nov 2012 20:44:06 +0200 Subject: [PATCH] main.c: Consider default argument as a config file If one does not specify any option, just gives an argument, it is a good assumption that one is giving a config file. Signed-off-by: Timo Kokkonen --- main.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/main.c b/main.c index 1d26539..9f344e5 100644 --- a/main.c +++ b/main.c @@ -46,6 +46,12 @@ int read_args(int argc, char *argv[], struct user_options *opts) return -1; } } + + while (optind < argc) { + opts->config_file = argv[optind]; + optind++; + } + return 0; } -- 2.45.0