Create stub autocomplete function
MODIFY
include/vcpkg_Commands.h
include/vcpkg_Commands.h
@@ -194,6 +194,11 @@ namespace vcpkg::Commands
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
+ namespace Autocomplete
+ {
+ void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
+ }
+
namespace Help
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);

ADD
src/commands_autocomplete.cpp
+#include "pch.h"
+
+#include "Paragraphs.h"
+#include "SortedVector.h"
+#include "vcpkg_Commands.h"
+#include "vcpkg_Maps.h"
+#include "vcpkg_System.h"
+
+namespace vcpkg::Commands::Autocomplete
+{
+ void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
+ {
+ static const std::string EXAMPLE =
+ Strings::format("The argument should be a command line to autocomplete.\n%s",
+ Commands::Help::create_example_string("autocomplete install z"));
+
+ args.check_max_arg_count(1, EXAMPLE);
+ args.check_and_get_optional_command_arguments({});
+
+ Checks::exit_success(VCPKG_LINE_INFO);
+ }
+}

MODIFY
src/commands_available_commands.cpp
src/commands_available_commands.cpp
@@ -34,7 +34,7 @@ namespace vcpkg::Commands
{"import", &Import::perform_and_exit},
{"cache", &Cache::perform_and_exit},
{"portsdiff", &PortsDiff::perform_and_exit},
- };
+ {"autocomplete", &Autocomplete::perform_and_exit}};
return t;
}

MODIFY
vcpkglib/vcpkglib.vcxproj
vcpkglib/vcpkglib.vcxproj
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\src\BinaryParagraph.cpp" />
+ <ClCompile Include="..\src\commands_autocomplete.cpp" />
<ClCompile Include="..\src\commands_ci.cpp" />
<ClCompile Include="..\src\commands_depends.cpp" />
<ClCompile Include="..\src\commands_env.cpp" />

MODIFY
vcpkglib/vcpkglib.vcxproj.filters
vcpkglib/vcpkglib.vcxproj.filters
<ClCompile Include="..\src\vcpkg_GlobalState.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\src\commands_autocomplete.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\SourceParagraph.h">

Create stub autocomplete function