From bfe6d2116349ae102d9b4ddef1d2da0f96f2256c Mon Sep 17 00:00:00 2001 From: bofdahof <172177156+bofdahof@users.noreply.github.com> Date: Sat, 8 Mar 2025 13:20:32 +1000 Subject: [PATCH] remove using namespace boost::program_options --- src/App/Application.cpp | 38 +++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/App/Application.cpp b/src/App/Application.cpp index 2c956013ae..8751ea2d87 100644 --- a/src/App/Application.cpp +++ b/src/App/Application.cpp @@ -174,7 +174,7 @@ using namespace App; //using namespace Base; //using namespace std; //using namespace boost; -using namespace boost::program_options; +//using namespace boost::program_options; using Base::FileInfo; namespace sp = std::placeholders; @@ -2215,20 +2215,20 @@ void Application::initTypes() namespace { -void parseProgramOptions(int ac, char ** av, const std::string& exe, variables_map& vm) +void parseProgramOptions(int ac, char ** av, const std::string& exe, boost::program_options::variables_map& vm) { // Declare a group of options that will be // allowed only on the command line - options_description generic("Generic options"); + boost::program_options::options_description generic("Generic options"); generic.add_options() ("version,v", "Prints version string") ("verbose", "Prints verbose version string") ("help,h", "Prints help message") ("console,c", "Starts in console mode") - ("response-file", value(),"Can be specified with '@name', too") + ("response-file", boost::program_options::value(),"Can be specified with '@name', too") ("dump-config", "Dumps configuration") - ("get-config", value(), "Prints the value of the requested configuration key") - ("set-config", value< std::vector >()->multitoken(), "Sets the value of a configuration key") + ("get-config", boost::program_options::value(), "Prints the value of the requested configuration key") + ("set-config", boost::program_options::value< std::vector >()->multitoken(), "Sets the value of a configuration key") ("keep-deprecated-paths", "If set then config files are kept on the old location") ; @@ -2240,18 +2240,18 @@ void parseProgramOptions(int ac, char ** av, const std::string& exe, variables_m boost::program_options::options_description config("Configuration"); config.add_options() ("write-log,l", descr.str().c_str()) - ("log-file", value(), "Unlike --write-log this allows logging to an arbitrary file") - ("user-cfg,u", value(),"User config file to load/save user settings") - ("system-cfg,s", value(),"System config file to load/save system settings") - ("run-test,t", value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests.") - ("run-open,r", value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. Keeps UI open after test(s) complete.") - ("module-path,M", value< std::vector >()->composing(),"Additional module paths") - ("macro-path,E", value< std::vector >()->composing(),"Additional macro paths") - ("python-path,P", value< std::vector >()->composing(),"Additional python paths") - ("disable-addon", value< std::vector >()->composing(),"Disable a given addon.") + ("log-file", boost::program_options::value(), "Unlike --write-log this allows logging to an arbitrary file") + ("user-cfg,u", boost::program_options::value(),"User config file to load/save user settings") + ("system-cfg,s", boost::program_options::value(),"System config file to load/save system settings") + ("run-test,t", boost::program_options::value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests.") + ("run-open,r", boost::program_options::value()->implicit_value(""),"Run a given test case (use 0 (zero) to run all tests). If no argument is provided then return list of all available tests. Keeps UI open after test(s) complete.") + ("module-path,M", boost::program_options::value< std::vector >()->composing(),"Additional module paths") + ("macro-path,E", boost::program_options::value< std::vector >()->composing(),"Additional macro paths") + ("python-path,P", boost::program_options::value< std::vector >()->composing(),"Additional python paths") + ("disable-addon", boost::program_options::value< std::vector >()->composing(),"Disable a given addon.") ("single-instance", "Allow to run a single instance of the application") ("safe-mode", "Force enable safe mode") - ("pass", value< std::vector >()->multitoken(), "Ignores the following arguments and pass them through to be used by a script") + ("pass", boost::program_options::value< std::vector >()->multitoken(), "Ignores the following arguments and pass them through to be used by a script") ; @@ -2318,7 +2318,7 @@ void parseProgramOptions(int ac, char ** av, const std::string& exe, variables_m // 0000659: SIGABRT on startup in boost::program_options (Boost 1.49) // Add some text to the constructor - options_description cmdline_options("Command-line options"); + boost::program_options::options_description cmdline_options("Command-line options"); cmdline_options.add(generic).add(config).add(hidden); boost::program_options::options_description config_file_options("Config"); @@ -2383,7 +2383,7 @@ void parseProgramOptions(int ac, char ** av, const std::string& exe, variables_m } } -void processProgramOptions(const variables_map& vm, std::map& mConfig) +void processProgramOptions(const boost::program_options::variables_map& vm, std::map& mConfig) { if (vm.count("version")) { std::stringstream str; @@ -2582,7 +2582,7 @@ void Application::initConfig(int argc, char ** argv) } } - variables_map vm; + boost::program_options::variables_map vm; { BOOST_SCOPE_EXIT_ALL(&) { // console-mode needs to be set (if possible) also in case parseProgramOptions