From fbcb6260985e142286d8bc6f541f6ba8401ed877 Mon Sep 17 00:00:00 2001 From: nicole mazzuca Date: Thu, 4 Nov 2021 17:27:51 -0700 Subject: [PATCH 1/3] [help] remove help text for things we don't want people using --- include/vcpkg/remove.h | 4 +--- src/vcpkg/commands.buildexternal.cpp | 2 +- src/vcpkg/commands.fetch.cpp | 2 +- src/vcpkg/install.cpp | 2 +- src/vcpkg/remove.cpp | 12 ++++++------ src/vcpkg/vcpkgcmdarguments.cpp | 8 -------- 6 files changed, 10 insertions(+), 20 deletions(-) diff --git a/include/vcpkg/remove.h b/include/vcpkg/remove.h index 74e56aaba5..8015c7fd96 100644 --- a/include/vcpkg/remove.h +++ b/include/vcpkg/remove.h @@ -8,14 +8,12 @@ namespace vcpkg::Remove { - enum class Purge + enum class Purge: bool { NO = 0, YES }; - inline Purge to_purge(const bool value) { return value ? Purge::YES : Purge::NO; } - void perform_remove_plan_action(const VcpkgPaths& paths, const Dependencies::RemovePlanAction& action, const Purge purge, diff --git a/src/vcpkg/commands.buildexternal.cpp b/src/vcpkg/commands.buildexternal.cpp index f81d111d3c..afe65c2771 100644 --- a/src/vcpkg/commands.buildexternal.cpp +++ b/src/vcpkg/commands.buildexternal.cpp @@ -10,7 +10,7 @@ namespace vcpkg::Commands::BuildExternal { const CommandStructure COMMAND_STRUCTURE = { - create_example_string(R"(build_external zlib2 C:\path\to\dir\with\controlfile\)"), + create_example_string(R"(build-external zlib2 C:\path\to\dir\with\controlfile\)"), 2, 2, {}, diff --git a/src/vcpkg/commands.fetch.cpp b/src/vcpkg/commands.fetch.cpp index 89c9c30225..6cd57ae783 100644 --- a/src/vcpkg/commands.fetch.cpp +++ b/src/vcpkg/commands.fetch.cpp @@ -7,7 +7,7 @@ namespace vcpkg::Commands::Fetch { const CommandStructure COMMAND_STRUCTURE = { - Strings::format("The argument should be tool name\n%s", create_example_string("fetch cmake")), + Strings::format("The argument should be a tool name\n%s", create_example_string("fetch cmake")), 1, 1, {}, diff --git a/src/vcpkg/install.cpp b/src/vcpkg/install.cpp index 10fc0008ce..575bad73e4 100644 --- a/src/vcpkg/install.cpp +++ b/src/vcpkg/install.cpp @@ -568,7 +568,7 @@ namespace vcpkg::Install }}; static constexpr std::array INSTALL_SETTINGS = {{ - {OPTION_XUNIT, "File to output results in XUnit format (Internal use)"}, + {OPTION_XUNIT, ""}, // internal use {OPTION_WRITE_PACKAGES_CONFIG, "Writes out a NuGet packages.config-formatted file for use with external binary caching.\nSee `vcpkg help " "binarycaching` for more information."}, diff --git a/src/vcpkg/remove.cpp b/src/vcpkg/remove.cpp index 09b7b6815f..c46851351a 100644 --- a/src/vcpkg/remove.cpp +++ b/src/vcpkg/remove.cpp @@ -171,8 +171,8 @@ namespace vcpkg::Remove static constexpr StringLiteral OPTION_OUTDATED = "outdated"; static constexpr std::array SWITCHES = {{ - {OPTION_PURGE, "Remove the cached copy of the package (default)"}, - {OPTION_NO_PURGE, "Do not remove the cached copy of the package (deprecated)"}, + {OPTION_PURGE, ""}, + {OPTION_NO_PURGE, ""}, {OPTION_RECURSE, "Allow removal of packages not explicitly specified on the command line"}, {OPTION_DRY_RUN, "Print the packages to be removed, but do not remove them"}, {OPTION_OUTDATED, "Select all packages with versions that do not match the portfiles"}, @@ -242,15 +242,15 @@ namespace vcpkg::Remove Input::check_triplet(spec.triplet(), paths); } - const bool no_purge_was_passed = Util::Sets::contains(options.switches, OPTION_NO_PURGE); - const bool purge_was_passed = Util::Sets::contains(options.switches, OPTION_PURGE); - if (purge_was_passed && no_purge_was_passed) + const bool no_purge = Util::Sets::contains(options.switches, OPTION_NO_PURGE); + if (no_purge && Util::Sets::contains(options.switches, OPTION_PURGE)) { print2(Color::error, "Error: cannot specify both --no-purge and --purge.\n"); print2(COMMAND_STRUCTURE.example_text); Checks::exit_fail(VCPKG_LINE_INFO); } - const Purge purge = to_purge(purge_was_passed || !no_purge_was_passed); + const Purge purge = no_purge ? Purge::NO : Purge::YES; + const bool is_recursive = Util::Sets::contains(options.switches, OPTION_RECURSE); const bool dry_run = Util::Sets::contains(options.switches, OPTION_DRY_RUN); diff --git a/src/vcpkg/vcpkgcmdarguments.cpp b/src/vcpkg/vcpkgcmdarguments.cpp index 3857017ace..d012a6de79 100644 --- a/src/vcpkg/vcpkgcmdarguments.cpp +++ b/src/vcpkg/vcpkgcmdarguments.cpp @@ -645,15 +645,7 @@ namespace vcpkg table.format("", "(default: " + format_environment_variable("VCPKG_DOWNLOADS") + ')'); table.format(opt(VCPKG_ROOT_DIR_ARG, "=", ""), "Specify the vcpkg root directory"); table.format("", "(default: " + format_environment_variable("VCPKG_ROOT") + ')'); - table.format(opt(BUILDTREES_ROOT_DIR_ARG, "=", ""), - "(Experimental) Specify the buildtrees root directory"); table.format(opt(INSTALL_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the install root directory"); - table.format(opt(PACKAGES_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the packages root directory"); - table.format(opt(SCRIPTS_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the scripts root directory"); - table.format(opt(BUILTIN_PORTS_ROOT_DIR_ARG, "=", ""), - "(Experimental) Specify the packages root directory"); - table.format(opt(BUILTIN_REGISTRY_VERSIONS_DIR_ARG, "=", ""), - "(Experimental) Specify the versions root directory"); table.format(opt(JSON_SWITCH, "", ""), "(Experimental) Request JSON output"); } From f28de109db4aef21c3884054cf229fb6c52742cd Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Fri, 5 Nov 2021 11:24:28 -0700 Subject: [PATCH 2/3] clang-format --- include/vcpkg/remove.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/vcpkg/remove.h b/include/vcpkg/remove.h index 8015c7fd96..5ac1cbb45f 100644 --- a/include/vcpkg/remove.h +++ b/include/vcpkg/remove.h @@ -8,7 +8,7 @@ namespace vcpkg::Remove { - enum class Purge: bool + enum class Purge : bool { NO = 0, YES From d56cd38775a89ae5bd4740394689815d2cbc7c4a Mon Sep 17 00:00:00 2001 From: Billy Robert O'Neal III Date: Fri, 19 Nov 2021 12:52:53 -0800 Subject: [PATCH 3/3] Restore buildtrees and packages for now until we have the better replacement. --- src/vcpkg/vcpkgcmdarguments.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/vcpkg/vcpkgcmdarguments.cpp b/src/vcpkg/vcpkgcmdarguments.cpp index 8906c89e3f..00cda1d505 100644 --- a/src/vcpkg/vcpkgcmdarguments.cpp +++ b/src/vcpkg/vcpkgcmdarguments.cpp @@ -646,7 +646,10 @@ namespace vcpkg table.format("", "(default: " + format_environment_variable("VCPKG_DOWNLOADS") + ')'); table.format(opt(VCPKG_ROOT_DIR_ARG, "=", ""), "Specify the vcpkg root directory"); table.format("", "(default: " + format_environment_variable("VCPKG_ROOT") + ')'); + table.format(opt(BUILDTREES_ROOT_DIR_ARG, "=", ""), + "(Experimental) Specify the buildtrees root directory"); table.format(opt(INSTALL_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the install root directory"); + table.format(opt(PACKAGES_ROOT_DIR_ARG, "=", ""), "(Experimental) Specify the packages root directory"); table.format(opt(JSON_SWITCH, "", ""), "(Experimental) Request JSON output"); }