aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src/vcpkg.cpp
diff options
context:
space:
mode:
authornicole mazzuca <mazzucan@outlook.com>2020-08-01 13:45:17 -0700
committerGitHub <noreply@github.com>2020-08-01 13:45:17 -0700
commit54ec974afefae1864b423335ba8bcb64291d2317 (patch)
tree24443f5bcb949a06aa5edef8850a7e633baa6a6f /toolsrc/src/vcpkg.cpp
parent00e44369cb23f911821ee96888cbb4785810ba07 (diff)
downloadvcpkg-54ec974afefae1864b423335ba8bcb64291d2317.tar.gz
vcpkg-54ec974afefae1864b423335ba8bcb64291d2317.zip
[vcpkg] Refactor commands 2: Electric Boogaloo (#12641)
* Add BasicCommand and VersionCommand * Add ContactCommand * test get_available_commands_type_c * Change get_available_commands_type_c to return objects * Add TripletCommand & InstallCommand * Add SetInstalledCommand * add linking tests * Add CICommand * Add remaining *Command objects * Add tests for commands_type_a * Move over to using const TripletCommand* for commands_type_a * Add PathsCommand * Add SearchCommand * add test for commands_type_b * add *Command for all type b commands * Switch from function pointers to PathsCommand for everything * format * rename get_available_commands also remove CommandType* types
Diffstat (limited to 'toolsrc/src/vcpkg.cpp')
-rw-r--r--toolsrc/src/vcpkg.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/toolsrc/src/vcpkg.cpp b/toolsrc/src/vcpkg.cpp
index 2bfa3f508..0158b3755 100644
--- a/toolsrc/src/vcpkg.cpp
+++ b/toolsrc/src/vcpkg.cpp
@@ -68,9 +68,9 @@ static void inner(vcpkg::Files::Filesystem& fs, const VcpkgCmdArguments& args)
}
};
- if (const auto command_function = find_command(Commands::get_available_commands_type_c()))
+ if (const auto command_function = find_command(Commands::get_available_basic_commands()))
{
- return command_function->function(args, fs);
+ return command_function->function->perform_and_exit(args, fs);
}
const VcpkgPaths paths(fs, args);
@@ -104,17 +104,17 @@ static void inner(vcpkg::Files::Filesystem& fs, const VcpkgCmdArguments& args)
}
}
- if (const auto command_function = find_command(Commands::get_available_commands_type_b()))
+ if (const auto command_function = find_command(Commands::get_available_paths_commands()))
{
- return command_function->function(args, paths);
+ return command_function->function->perform_and_exit(args, paths);
}
Triplet default_triplet = vcpkg::default_triplet(args);
Input::check_triplet(default_triplet, paths);
- if (const auto command_function = find_command(Commands::get_available_commands_type_a()))
+ if (const auto command_function = find_command(Commands::get_available_triplet_commands()))
{
- return command_function->function(args, paths, default_triplet);
+ return command_function->function->perform_and_exit(args, paths, default_triplet);
}
return invalid_command(args.command);