diff options
author | MetroWind <chris.corsair@gmail.com> | 2025-09-07 09:42:33 -0700 |
---|---|---|
committer | MetroWind <chris.corsair@gmail.com> | 2025-09-07 09:42:33 -0700 |
commit | ea0d3220db995018335c48eb06b9794235ff436b (patch) | |
tree | 892564cdd4946c6ee9c1051bc31ff5c7bba6ddf1 /src/main.cpp |
Initial commit, mostly just copied from shrt.
Diffstat (limited to 'src/main.cpp')
-rw-r--r-- | src/main.cpp | 29 |
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 | |||
12 | int 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 | } | ||