aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--toolsrc/include/vcpkg/base/util.h4
-rw-r--r--toolsrc/src/vcpkg/commands.contact.cpp16
2 files changed, 15 insertions, 5 deletions
diff --git a/toolsrc/include/vcpkg/base/util.h b/toolsrc/include/vcpkg/base/util.h
index 3d56c1e10..8d78fd6cc 100644
--- a/toolsrc/include/vcpkg/base/util.h
+++ b/toolsrc/include/vcpkg/base/util.h
@@ -24,8 +24,8 @@ namespace vcpkg::Util
namespace Sets
{
- template<class Container, class T = ElementT<Container>>
- bool contains(const Container& container, const T& item)
+ template<class Container>
+ bool contains(const Container& container, const ElementT<Container>& item)
{
return container.find(item) != container.cend();
}
diff --git a/toolsrc/src/vcpkg/commands.contact.cpp b/toolsrc/src/vcpkg/commands.contact.cpp
index 5d62faeea..07dcea80e 100644
--- a/toolsrc/src/vcpkg/commands.contact.cpp
+++ b/toolsrc/src/vcpkg/commands.contact.cpp
@@ -12,19 +12,29 @@ namespace vcpkg::Commands::Contact
return S_EMAIL;
}
+ static const CommandSwitch switches[] = {{"--survey", "Launch default browser to the current vcpkg survey"}};
+
const CommandStructure COMMAND_STRUCTURE = {
Help::create_example_string("contact"),
0,
0,
- {},
+ {switches, {}},
nullptr,
};
void perform_and_exit(const VcpkgCmdArguments& args)
{
- args.parse_arguments(COMMAND_STRUCTURE);
+ auto parsed_args = args.parse_arguments(COMMAND_STRUCTURE);
- System::println("Send an email to %s with any feedback.", email());
+ if (Util::Sets::contains(parsed_args.switches, switches[0].name))
+ {
+ System::cmd_execute("start https://aka.ms/NPS_vcpkg");
+ System::println("Default browser launched to https://aka.ms/NPS_vcpkg, thank you for your feedback!");
+ }
+ else
+ {
+ System::println("Send an email to %s with any feedback.", email());
+ }
Checks::exit_success(VCPKG_LINE_INFO);
}
}