aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaria Tavlaki <mariataylaki@hotmail.com>2017-10-01 22:17:33 +0300
committerMaria Tavlaki <mariataylaki@hotmail.com>2017-10-02 01:23:55 +0300
commitb3e06443eab560d5de848f2a066e1baa477fa57b (patch)
treebd31e71390610e1fdcc03597f13dde248fee5bbe
parent2de9f83ff22774d0f70e3ee8158b26c494f5ea30 (diff)
downloadvcpkg-b3e06443eab560d5de848f2a066e1baa477fa57b.tar.gz
vcpkg-b3e06443eab560d5de848f2a066e1baa477fa57b.zip
Create stub autocomplete function
-rw-r--r--toolsrc/include/vcpkg_Commands.h5
-rw-r--r--toolsrc/src/commands_autocomplete.cpp22
-rw-r--r--toolsrc/src/commands_available_commands.cpp2
-rw-r--r--toolsrc/vcpkglib/vcpkglib.vcxproj1
-rw-r--r--toolsrc/vcpkglib/vcpkglib.vcxproj.filters3
5 files changed, 32 insertions, 1 deletions
diff --git a/toolsrc/include/vcpkg_Commands.h b/toolsrc/include/vcpkg_Commands.h
index 590f0208c..7cfa2760e 100644
--- a/toolsrc/include/vcpkg_Commands.h
+++ b/toolsrc/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);
diff --git a/toolsrc/src/commands_autocomplete.cpp b/toolsrc/src/commands_autocomplete.cpp
new file mode 100644
index 000000000..71154445d
--- /dev/null
+++ b/toolsrc/src/commands_autocomplete.cpp
@@ -0,0 +1,22 @@
+#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);
+ }
+}
diff --git a/toolsrc/src/commands_available_commands.cpp b/toolsrc/src/commands_available_commands.cpp
index 87cc43dca..d3280e6d7 100644
--- a/toolsrc/src/commands_available_commands.cpp
+++ b/toolsrc/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;
}
diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj b/toolsrc/vcpkglib/vcpkglib.vcxproj
index edecd7720..0c3c7105d 100644
--- a/toolsrc/vcpkglib/vcpkglib.vcxproj
+++ b/toolsrc/vcpkglib/vcpkglib.vcxproj
@@ -181,6 +181,7 @@
</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" />
diff --git a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters
index 2fbf3d929..668aa48d6 100644
--- a/toolsrc/vcpkglib/vcpkglib.vcxproj.filters
+++ b/toolsrc/vcpkglib/vcpkglib.vcxproj.filters
@@ -180,6 +180,9 @@
<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">