X-Git-Url: http://git.wpitchoune.net/gitweb/?p=ppastats.git;a=blobdiff_plain;f=src%2Fmain.c;fp=src%2Fmain.c;h=1629053490be90c85246977fb262bfb4a277d99f;hp=1997551ef8a5271614d7183ce7510b0eadccf1a3;hb=cacd81cd1065cf9a145bb2fbe66c383ad3c90206;hpb=f5fbf6bcfcac7e2b6df90e00f618c642539d013d diff --git a/src/main.c b/src/main.c index 1997551..1629053 100644 --- a/src/main.c +++ b/src/main.c @@ -86,7 +86,7 @@ static void display_published_binaries(const char *owner, static struct option long_options[] = { {"version", no_argument, 0, 'v'}, {"help", no_argument, 0, 'h'}, - {"html", no_argument, 0, 't'}, + {"html", required_argument, 0, 't'}, {"debug", no_argument, 0, 'd'}, {"status", required_argument, 0, 's'}, {0, 0, 0, 0} @@ -140,14 +140,16 @@ int main(int argc, char **argv) int output_html = 0; char *package_status = NULL; int cmdok = 1; + char *output_dir = NULL; program_name = argv[0]; - while ((optc = getopt_long(argc, argv, "vhtds:", long_options, + while ((optc = getopt_long(argc, argv, "vht:ds:", long_options, NULL)) != -1) { switch (optc) { case 't': output_html = 1; + output_dir = strdup(optarg); break; case 'd': debug = 1; @@ -178,12 +180,13 @@ int main(int argc, char **argv) ppa = argv[optind+1]; if (output_html) - ppa_to_html(owner, ppa, package_status); + ppa_to_html(owner, ppa, package_status, output_dir); else display_published_binaries(owner, ppa, package_status); /* for valgrind.... */ free(package_status); + free(output_dir); lp_ws_cleanup(); cache_cleanup();