diff --git a/toolsrc/include/vcpkg/vcpkgcmdarguments.h b/toolsrc/include/vcpkg/vcpkgcmdarguments.h index d84be9c22f..bce22b6f97 100644 --- a/toolsrc/include/vcpkg/vcpkgcmdarguments.h +++ b/toolsrc/include/vcpkg/vcpkgcmdarguments.h @@ -79,6 +79,8 @@ namespace vcpkg Optional sendmetrics = nullopt; Optional printmetrics = nullopt; + // feature flags + Optional featurepackages = nullopt; std::string command; std::vector command_arguments; diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp index adb32c7235..ffda7ede91 100644 --- a/toolsrc/src/vcpkg.cpp +++ b/toolsrc/src/vcpkg.cpp @@ -265,6 +265,7 @@ int main(const int argc, const char* const* const argv) const VcpkgCmdArguments args = VcpkgCmdArguments::create_from_command_line(argc, argv); + if (const auto p = args.featurepackages.get()) GlobalState::feature_packages = *p; if (const auto p = args.printmetrics.get()) Metrics::g_metrics.lock()->set_print_metrics(*p); if (const auto p = args.sendmetrics.get()) Metrics::g_metrics.lock()->set_send_metrics(*p); if (const auto p = args.debug.get()) GlobalState::debugging = *p; diff --git a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp index 84ad17fe31..18acf8e12e 100644 --- a/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp +++ b/toolsrc/src/vcpkg/vcpkgcmdarguments.cpp @@ -126,12 +126,13 @@ namespace vcpkg } if (arg == "--featurepackages") { - GlobalState::feature_packages = true; + parse_switch(true, "featurepackages", args.featurepackages); continue; } if (arg == "--no-featurepackages") { - GlobalState::feature_packages = false; + parse_switch(false, "featurepackages", args.featurepackages); + continue; continue; }