From ea0d3220db995018335c48eb06b9794235ff436b Mon Sep 17 00:00:00 2001 From: MetroWind Date: Sun, 7 Sep 2025 09:42:33 -0700 Subject: Initial commit, mostly just copied from shrt. --- src/main.cpp | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/main.cpp (limited to 'src/main.cpp') 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 @@ +#include + +#include +#include +#include +#include + +#include "config.hpp" +#include "data.hpp" +#include "app.hpp" + +int main(int argc, char** argv) +{ + cxxopts::Options cmd_options( + "shrt", "A naively simple URL shortener"); + cmd_options.add_options() + ("c,config", "Config file", + cxxopts::value()->default_value("/etc/shrt.yaml")) + ("h,help", "Print this message."); + auto opts = cmd_options.parse(argc, argv); + + if(opts.count("help")) + { + std::cout << cmd_options.help() << std::endl; + return 0; + } + + return 0; +} -- cgit v1.2.3-70-g09d2