]> git.itanic.dy.fi Git - rrdd/commitdiff
main.c: Consider default argument as a config file
authorTimo Kokkonen <timo.t.kokkonen@iki.fi>
Mon, 19 Nov 2012 18:44:06 +0000 (20:44 +0200)
committerTimo Kokkonen <timo.t.kokkonen@iki.fi>
Mon, 19 Nov 2012 20:10:12 +0000 (22:10 +0200)
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 <timo.t.kokkonen@iki.fi>
main.c

diff --git a/main.c b/main.c
index 1d26539900810a821f6aff6235e56e89cbb5fc7e..9f344e5f2824f0804c5bd2d82c7deab2380bc9a2 100644 (file)
--- 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;
 }