diff --git a/include/vcpkg/commands.build.h b/include/vcpkg/commands.build.h index 747c130141..6c17116a69 100644 --- a/include/vcpkg/commands.build.h +++ b/include/vcpkg/commands.build.h @@ -72,7 +72,6 @@ namespace vcpkg CleanDownloads clean_downloads; DownloadTool download_tool; BackcompatFeatures backcompat_features; - PrintUsage print_usage; KeepGoing keep_going; }; diff --git a/include/vcpkg/commands.set-installed.h b/include/vcpkg/commands.set-installed.h index cec186a9e8..1db780b9c8 100644 --- a/include/vcpkg/commands.set-installed.h +++ b/include/vcpkg/commands.set-installed.h @@ -40,6 +40,7 @@ namespace vcpkg const CMakeVars::CMakeVarProvider& cmake_vars, ActionPlan action_plan, DryRun dry_run, + PrintUsage print_usage, const Optional& maybe_pkgconfig, bool include_manifest_in_github_issue); void command_set_installed_and_exit(const VcpkgCmdArguments& args, diff --git a/src/vcpkg/commands.build-external.cpp b/src/vcpkg/commands.build-external.cpp index 9ef71a66a6..2cc4a64316 100644 --- a/src/vcpkg/commands.build-external.cpp +++ b/src/vcpkg/commands.build-external.cpp @@ -36,7 +36,6 @@ namespace vcpkg CleanDownloads::No, DownloadTool::Builtin, BackcompatFeatures::Allow, - PrintUsage::Yes, }; const FullPackageSpec spec = diff --git a/src/vcpkg/commands.build.cpp b/src/vcpkg/commands.build.cpp index d1a8a8d494..66ec8c2500 100644 --- a/src/vcpkg/commands.build.cpp +++ b/src/vcpkg/commands.build.cpp @@ -98,7 +98,6 @@ namespace vcpkg CleanDownloads::No, DownloadTool::Builtin, BackcompatFeatures::Allow, - PrintUsage::Yes, }; const FullPackageSpec spec = diff --git a/src/vcpkg/commands.ci.cpp b/src/vcpkg/commands.ci.cpp index 24581927f5..42270447c9 100644 --- a/src/vcpkg/commands.ci.cpp +++ b/src/vcpkg/commands.ci.cpp @@ -327,7 +327,6 @@ namespace vcpkg CleanDownloads::No, DownloadTool::Builtin, BackcompatFeatures::Prohibit, - PrintUsage::Yes, KeepGoing::Yes, }; diff --git a/src/vcpkg/commands.install.cpp b/src/vcpkg/commands.install.cpp index 2087e62835..6fe0808f8f 100644 --- a/src/vcpkg/commands.install.cpp +++ b/src/vcpkg/commands.install.cpp @@ -1055,8 +1055,7 @@ namespace vcpkg const auto unsupported_port_action = Util::Sets::contains(options.switches, SwitchAllowUnsupported) ? UnsupportedPortAction::Warn : UnsupportedPortAction::Error; - const PrintUsage print_cmake_usage = - Util::Sets::contains(options.switches, SwitchNoPrintUsage) ? PrintUsage::No : PrintUsage::Yes; + const bool print_cmake_usage = !Util::Sets::contains(options.switches, SwitchNoPrintUsage); get_global_metrics_collector().track_bool(BoolMetric::InstallManifestMode, paths.manifest_mode_enabled()); @@ -1125,7 +1124,6 @@ namespace vcpkg Util::Enum::to_enum(clean_after_build || clean_downloads_after_build), download_tool, prohibit_backcompat_features ? BackcompatFeatures::Prohibit : BackcompatFeatures::Allow, - print_cmake_usage, keep_going, }; @@ -1273,6 +1271,7 @@ namespace vcpkg var_provider, std::move(install_plan), dry_run ? DryRun::Yes : DryRun::No, + print_cmake_usage ? PrintUsage::No : PrintUsage::Yes, pkgsconfig, true); } @@ -1373,6 +1372,8 @@ namespace vcpkg binary_cache, null_build_logs_recorder()); + // Skip printing the summary without --keep-going because the status without it is 'obvious': everything was a + // success. if (keep_going == KeepGoing::Yes) { msg::print(summary.format()); @@ -1396,7 +1397,7 @@ namespace vcpkg fs.write_contents(it_xunit->second, xwriter.build_xml(default_triplet), VCPKG_LINE_INFO); } - if (build_package_options.print_usage == PrintUsage::Yes) + if (print_cmake_usage) { std::set printed_usages; for (auto&& result : summary.results) diff --git a/src/vcpkg/commands.set-installed.cpp b/src/vcpkg/commands.set-installed.cpp index 7bc701e519..0cc4ff4ff3 100644 --- a/src/vcpkg/commands.set-installed.cpp +++ b/src/vcpkg/commands.set-installed.cpp @@ -172,6 +172,7 @@ namespace vcpkg const CMakeVars::CMakeVarProvider& cmake_vars, ActionPlan action_plan, DryRun dry_run, + PrintUsage print_usage, const Optional& maybe_pkgconfig, bool include_manifest_in_github_issue) { @@ -257,7 +258,7 @@ namespace vcpkg } } - if (build_options.print_usage == PrintUsage::Yes) + if (print_usage == PrintUsage::Yes) { // Note that this differs from the behavior of `vcpkg install` in that it will print usage information for // packages named but not installed here @@ -287,15 +288,12 @@ namespace vcpkg .value_or_exit(VCPKG_LINE_INFO); }); - const bool dry_run = Util::Sets::contains(options.switches, SwitchDryRun); const auto only_downloads = Util::Sets::contains(options.switches, SwitchOnlyDownloads) ? OnlyDownloads::Yes : OnlyDownloads::No; const auto keep_going = Util::Sets::contains(options.switches, SwitchKeepGoing) || only_downloads == OnlyDownloads::Yes ? KeepGoing::Yes : KeepGoing::No; - const auto print_usage = - Util::Sets::contains(options.switches, SwitchNoPrintUsage) ? PrintUsage::No : PrintUsage::Yes; const auto unsupported_port_action = Util::Sets::contains(options.switches, SwitchAllowUnsupported) ? UnsupportedPortAction::Warn : UnsupportedPortAction::Error; @@ -312,7 +310,6 @@ namespace vcpkg CleanDownloads::No, DownloadTool::Builtin, prohibit_backcompat_features, - print_usage, keep_going, }; @@ -339,14 +336,17 @@ namespace vcpkg specs, {}, {nullptr, host_triplet, paths.packages(), unsupported_port_action, UseHeadVersion::No, Editable::No}); - command_set_installed_and_exit_ex(args, - paths, - host_triplet, - build_options, - *cmake_vars, - std::move(action_plan), - dry_run ? DryRun::Yes : DryRun::No, - pkgsconfig, - false); + + command_set_installed_and_exit_ex( + args, + paths, + host_triplet, + build_options, + *cmake_vars, + std::move(action_plan), + Util::Sets::contains(options.switches, SwitchDryRun) ? DryRun::Yes : DryRun::No, + Util::Sets::contains(options.switches, SwitchNoPrintUsage) ? PrintUsage::No : PrintUsage::Yes, + pkgsconfig, + false); } } // namespace vcpkg diff --git a/src/vcpkg/commands.upgrade.cpp b/src/vcpkg/commands.upgrade.cpp index a27ea0a6e6..ba1165faad 100644 --- a/src/vcpkg/commands.upgrade.cpp +++ b/src/vcpkg/commands.upgrade.cpp @@ -69,7 +69,6 @@ namespace vcpkg CleanDownloads::No, DownloadTool::Builtin, BackcompatFeatures::Allow, - PrintUsage::Yes, keep_going, };