diff --git a/rotagen.c b/rotagen.c index c2ed791..e5c9701 100644 --- a/rotagen.c +++ b/rotagen.c @@ -22,7 +22,7 @@ static void *pool_alloc(int size) return ptr; } -int main(void) +int main(int argc, char **argv) { free_ptr = &pool[0]; @@ -38,8 +38,9 @@ int main(void) } srand(seed); + const char *config_path = argc > 1 ? argv[1] : "rotagen.conf"; memset(&conf, 0, sizeof(conf)); - read_config("rotagen.conf", &conf); + read_config(config_path, &conf); struct slot_result *rota = pool_alloc(conf.num_slots * sizeof(struct slot_result));