Skip to content

Commit

Permalink
Don't log unknown commands (#259)
Browse files Browse the repository at this point in the history
  • Loading branch information
vicroms authored Nov 9, 2021
1 parent 3b80230 commit 025d276
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/vcpkg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <vcpkg/base/chrono.h>
#include <vcpkg/base/files.h>
#include <vcpkg/base/hash.h>
#include <vcpkg/base/pragmas.h>
#include <vcpkg/base/strings.h>
#include <vcpkg/base/system.debug.h>
Expand Down Expand Up @@ -74,7 +75,6 @@ static void invalid_command(const std::string& cmd)

static void inner(vcpkg::Filesystem& fs, const VcpkgCmdArguments& args)
{
LockGuardPtr<Metrics>(g_metrics)->track_property("command", args.command);
if (args.command.empty())
{
print_usage();
Expand All @@ -98,6 +98,7 @@ static void inner(vcpkg::Filesystem& fs, const VcpkgCmdArguments& args)

if (const auto command_function = find_command(Commands::get_available_basic_commands()))
{
LockGuardPtr<Metrics>(g_metrics)->track_property("command_name", command_function->name);
return command_function->function->perform_and_exit(args, fs);
}

Expand All @@ -108,6 +109,7 @@ static void inner(vcpkg::Filesystem& fs, const VcpkgCmdArguments& args)

if (const auto command_function = find_command(Commands::get_available_paths_commands()))
{
LockGuardPtr<Metrics>(g_metrics)->track_property("command_name", command_function->name);
return command_function->function->perform_and_exit(args, paths);
}

Expand All @@ -118,6 +120,7 @@ static void inner(vcpkg::Filesystem& fs, const VcpkgCmdArguments& args)

if (const auto command_function = find_command(Commands::get_available_triplet_commands()))
{
LockGuardPtr<Metrics>(g_metrics)->track_property("command_name", command_function->name);
return command_function->function->perform_and_exit(args, paths, default_triplet, host_triplet);
}

Expand Down

0 comments on commit 025d276

Please sign in to comment.