fixed style
[ppastats.git] / src / main.c
index 8af2dc6..b590c67 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011-2012 jeanfi@gmail.com
+ * Copyright (C) 2011-2014 jeanfi@gmail.com
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
 #include <string.h>
 
 #include "cache.h"
+#include <fcache.h>
 #include "html.h"
 #include "http.h"
-#include "log.h"
 #include "lp_ws.h"
 #include "config.h"
+#include <plog.h>
 #include "ppastats.h"
 
 static const char *program_name;
@@ -107,7 +108,7 @@ static void print_version()
 "<http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>\n"
 "This is free software: you are free to change and redistribute it.\n"
 "There is NO WARRANTY, to the extent permitted by law.\n"),
-              "2011-2012");
+              "2011-2014");
 }
 
 static void print_help()
@@ -198,17 +199,24 @@ int main(int argc, char **argv)
        }
 
        if (!cmdok || optind + 2 != argc) {
-               fprintf(stderr, _("Try `%s --help' for more information.\n"),
+               fprintf(stderr,
+                       _("Try `%s --help' for more information.\n"),
                        program_name);
                exit(EXIT_FAILURE);
        }
 
+       log_open("ppastats.log");
+
        owner = argv[optind];
        ppa = argv[optind+1];
 
        if (output_html)
-               ppa_to_html(owner, ppa, package_status, output_dir,
-                           install_static_files, ws_size);
+               ppa_to_html(owner,
+                           ppa,
+                           package_status,
+                           output_dir,
+                           install_static_files,
+                           ws_size);
        else
                display_published_binaries(owner, ppa, package_status, ws_size);
 
@@ -217,6 +225,8 @@ int main(int argc, char **argv)
        free(output_dir);
        http_cleanup();
        cache_cleanup();
+       fcache_cleanup();
+       html_cleanup();
 
        exit(EXIT_SUCCESS);
 }