Skip to content

Commit

Permalink
main: Move download callbacks setup after cmd parsing
Browse files Browse the repository at this point in the history
Otherwise `quiet` is not parsed yet.
  • Loading branch information
jan-kolarik committed Jun 6, 2024
1 parent c32cff4 commit beae855
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions dnf5/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1186,13 +1186,6 @@ int main(int argc, char * argv[]) try {
return 0;
}

auto download_callbacks_uptr = std::make_unique<dnf5::DownloadCallbacks>();
auto * download_callbacks = download_callbacks_uptr.get();
download_callbacks->set_show_total_bar_limit(static_cast<std::size_t>(-1));
if (!context.get_quiet()) {
base.set_download_callbacks(std::move(download_callbacks_uptr));
}

// Parse command line arguments
{
auto & arg_parser = context.get_argument_parser();
Expand Down Expand Up @@ -1245,6 +1238,13 @@ int main(int argc, char * argv[]) try {
}
}

auto download_callbacks_uptr = std::make_unique<dnf5::DownloadCallbacks>();
auto * download_callbacks = download_callbacks_uptr.get();
download_callbacks->set_show_total_bar_limit(static_cast<std::size_t>(-1));
if (!context.get_quiet()) {
base.set_download_callbacks(std::move(download_callbacks_uptr));
}

auto command = context.get_selected_command();

// Gets set to true when any repository is created from configuration or a
Expand Down

0 comments on commit beae855

Please sign in to comment.