mirror of https://github.com/microsoft/vcpkg.git
[vcpkg-contact] Add --survey so users can easily provide feedback
This commit is contained in:
parent
415789b42e
commit
71289ee5e8
|
|
@ -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();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue