From e97ac8066d3366959d8af31bf0a0c1deaa498c75 Mon Sep 17 00:00:00 2001 From: Michael Schroeder Date: Fri, 31 Oct 2008 15:12:00 +0000 Subject: [PATCH] - add '-o ' support --- tools/rpmdb2solv.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) 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); + } + /* * ??? */ -- 2.7.4