diff --git a/dnf5/commands/download/download.cpp b/dnf5/commands/download/download.cpp index 3839403d5..fef4f1237 100644 --- a/dnf5/commands/download/download.cpp +++ b/dnf5/commands/download/download.cpp @@ -88,6 +88,9 @@ void DownloadCommand::set_argument_parser() { url->set_const_value("true"); url->link_value(url_option); + + urlprotocol_valid_options = {"http", "https", "rsync", "ftp"}; + urlprotocol_option = {}; auto urlprotocol = parser.add_new_named_arg("urlprotocol"); urlprotocol->set_long_name("urlprotocol"); urlprotocol->set_description("When running with --url, limit to specific protocols"); @@ -96,7 +99,7 @@ void DownloadCommand::set_argument_parser() { [[maybe_unused]] ArgumentParser::NamedArg * arg, [[maybe_unused]] const char * option, const char * value) { if (urlprotocol_valid_options.find(value) == urlprotocol_valid_options.end()) { throw libdnf5::cli::ArgumentParserInvalidValueError( - _M(std::format("Invalid urlprotocol option: {}", value))) + M_(std::format("Invalid urlprotocol option: {}", value))) } urlprotocol_option.emplace_back(value); }); diff --git a/dnf5/commands/download/download.hpp b/dnf5/commands/download/download.hpp index 6aa7da2cd..9c787587f 100644 --- a/dnf5/commands/download/download.hpp +++ b/dnf5/commands/download/download.hpp @@ -41,8 +41,8 @@ class DownloadCommand : public Command { void run() override; private: - std::set urlprotocol_valid_options = {"http", "https", "rsync", "ftp"}; - std::set urlprotocol_option = {}; + std::set urlprotocol_valid_options; + std::set urlprotocol_option; libdnf5::OptionBool * resolve_option{nullptr}; libdnf5::OptionBool * alldeps_option{nullptr}; libdnf5::OptionBool * url_option{nullptr};