From 8a0b8055c6ada11052f559e285c0983a4ea19680 Mon Sep 17 00:00:00 2001 From: tastytea Date: Sun, 15 Nov 2020 17:46:00 +0100 Subject: [PATCH] Put using blocks into main(). --- src/generators/html.cpp | 8 +++++--- src/generators/rss.cpp | 16 ++++++++-------- 2 files changed, 13 insertions(+), 11 deletions(-) diff --git a/src/generators/html.cpp b/src/generators/html.cpp index 9312eee..f22f9c6 100644 --- a/src/generators/html.cpp +++ b/src/generators/html.cpp @@ -15,6 +15,7 @@ */ #include "html.hpp" + #include "cgi.hpp" #include "config.hpp" #include "files.hpp" @@ -22,6 +23,7 @@ #include "git.hpp" #include "json.hpp" +#include #include #include #include @@ -167,11 +169,11 @@ void copy_screenshots(const fs::path &directory) } // namespace FediBlock::html -using namespace FediBlock; -using namespace FediBlock::html; - int main(int argc, char *argv[]) { + using namespace FediBlock; + using namespace FediBlock::html; + const vector args(argv, argv + argc); if (argc <= 1) { diff --git a/src/generators/rss.cpp b/src/generators/rss.cpp index 21a77b3..05596ec 100644 --- a/src/generators/rss.cpp +++ b/src/generators/rss.cpp @@ -183,16 +183,16 @@ void write_rss(ostream &out, const vector &entries, } // namespace FediBlock::rss -using std::cerr; -using std::cout; -using std::exception; -using std::runtime_error; - -using namespace FediBlock; -using namespace FediBlock::rss; - int main(int /*argc*/, char * /*argv*/[]) { + using namespace FediBlock; + using namespace FediBlock::rss; + + using std::cerr; + using std::cout; + using std::exception; + using std::runtime_error; + git::init(true);