From: Michael Schroeder Date: Fri, 31 Oct 2008 15:12:00 +0000 (+0000) Subject: - add '-o ' support X-Git-Tag: BASE-SuSE-Code-12_1-Branch~406 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e97ac8066d3366959d8af31bf0a0c1deaa498c75;p=platform%2Fupstream%2Flibsolv.git - add '-o ' support --- diff --git a/tools/rpmdb2solv.c b/tools/rpmdb2solv.c index 8c02476..6f3f424 100644 --- a/tools/rpmdb2solv.c +++ b/tools/rpmdb2solv.c @@ -60,12 +60,13 @@ main(int argc, char **argv) const char *basefile = 0; char *proddir = 0; const char *attribute = 0; + char *outfile = 0; /* * parse arguments */ - while ((c = getopt(argc, argv, "Pa:hnxb:r:p:")) >= 0) + while ((c = getopt(argc, argv, "Pa:hnxb:r:p:o:")) >= 0) switch (c) { case 'h': @@ -92,10 +93,19 @@ main(int argc, char **argv) case 'x': extrapool = 1; break; + case 'o': + outfile = optarg; + break; default: usage(1); } + if (outfile && !freopen(outfile, "w", stdout)) + { + perror(outfile); + exit(1); + } + /* * ??? */