From: Felix Fietkau Date: Sat, 29 Jan 2011 02:22:40 +0000 (+0000) Subject: scripts/config: add an option for making the conf tool write to a different file X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=b0f60f8023e2c72d821ca12dff7d58d034822fde;p=openwrt%2Fstaging%2Fblocktrron.git scripts/config: add an option for making the conf tool write to a different file SVN-Revision: 25230 --- diff --git a/scripts/config/conf.c b/scripts/config/conf.c index 6589aee451..0a44a2edd1 100644 --- a/scripts/config/conf.c +++ b/scripts/config/conf.c @@ -508,9 +508,10 @@ int main(int ac, char **av) { int i = 1; const char *name; + char *output = NULL; struct stat tmpstat; - if (ac > i && av[i][0] == '-') { + while (ac > i && av[i][0] == '-') { switch (av[i++][1]) { case 'o': input_mode = ask_new; @@ -531,6 +532,9 @@ int main(int ac, char **av) exit(1); } break; + case 'w': + output = av[i++]; + break; case 'n': input_mode = set_no; break; @@ -601,7 +605,7 @@ int main(int ac, char **av) conf_cnt = 0; check_conf(&rootmenu); } while (conf_cnt); - if (conf_write(NULL)) { + if (conf_write(output)) { fprintf(stderr, _("\n*** Error during writing of the build configuration.\n\n")); return 1; }