Skip to content

Commit

Permalink
testing lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
derickdiaz committed Jan 23, 2024
1 parent 50581fe commit 27641f9
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion dnf5/commands/download/download.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand All @@ -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);
});
Expand Down
4 changes: 2 additions & 2 deletions dnf5/commands/download/download.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class DownloadCommand : public Command {
void run() override;

private:
std::set<std::string> urlprotocol_valid_options = {"http", "https", "rsync", "ftp"};
std::set<std::string> urlprotocol_option = {};
std::set<std::string> urlprotocol_valid_options;
std::set<std::string> urlprotocol_option;
libdnf5::OptionBool * resolve_option{nullptr};
libdnf5::OptionBool * alldeps_option{nullptr};
libdnf5::OptionBool * url_option{nullptr};
Expand Down

0 comments on commit 27641f9

Please sign in to comment.