From b0854812aa22ca014f62c9ef77295ae4c8942571 Mon Sep 17 00:00:00 2001 From: Thomas Windt Date: Sat, 21 Oct 2023 20:03:50 +0200 Subject: [PATCH] WIP: initial draft for server cli refactoring --- src/murmur/main.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/murmur/main.cpp b/src/murmur/main.cpp index 9bb5a730836..6e3ed914fa5 100644 --- a/src/murmur/main.cpp +++ b/src/murmur/main.cpp @@ -16,7 +16,8 @@ #include "ServerDB.h" #include "Version.h" -#include +#include +#include #include #include #include @@ -208,7 +209,7 @@ auto parseCLI(int argc, char **argv) { struct { bool quit = false; boost::optional< std::string > ini_file; - boost::optional< std::tuple< std::string, int > > supw_srv; + boost::optional< boost::tuple< std::string, int > > supw_srv; boost::optional< int > disable_su_srv; bool verbose_logging = false; #ifdef QT_NO_DEBUG @@ -233,7 +234,7 @@ auto parseCLI(int argc, char **argv) { ->option_text("") ->expected(1, 2) ->check(CLI::ExistingFile); - app.add_option_no_stream("-w,--supw", options.supw_srv, "Set password for 'SuperUser' account on server srv.") + app.add_option("-w,--supw", options.supw_srv, "Set password for 'SuperUser' account on server srv.") ->option_text(" [srv]") ->expected(1, 2); #ifdef Q_OS_UNIX @@ -386,8 +387,8 @@ int main(int argc, char **argv) { if (cli_options.supw_srv.has_value()) { auto tuple = cli_options.supw_srv.get(); - supw = QString::fromStdString(std::get< 0 >(tuple)); - sunum = std::get< 1 >(tuple); + supw = QString::fromStdString(tuple.get<0>()); + sunum = tuple.get<1>(); #ifdef Q_OS_LINUX } else if (cli_options.read_supw_srv.has_value()) { // Note that it is essential to set detach = false here. If this is ever to be changed, the code part