aboutsummaryrefslogtreecommitdiff
path: root/src/main.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.cpp')
-rw-r--r--src/main.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
new file mode 100644
index 0000000..1aceef1
--- /dev/null
+++ b/src/main.cpp
@@ -0,0 +1,29 @@
1#include <memory>
2
3#include <cxxopts.hpp>
4#include <spdlog/spdlog.h>
5#include <mw/url.hpp>
6#include <mw/error.hpp>
7
8#include "config.hpp"
9#include "data.hpp"
10#include "app.hpp"
11
12int main(int argc, char** argv)
13{
14 cxxopts::Options cmd_options(
15 "shrt", "A naively simple URL shortener");
16 cmd_options.add_options()
17 ("c,config", "Config file",
18 cxxopts::value<std::string>()->default_value("/etc/shrt.yaml"))
19 ("h,help", "Print this message.");
20 auto opts = cmd_options.parse(argc, argv);
21
22 if(opts.count("help"))
23 {
24 std::cout << cmd_options.help() << std::endl;
25 return 0;
26 }
27
28 return 0;
29}