aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-09-22 00:06:37 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2016-09-22 00:06:37 -0700
commit4f80532991f5b9d4d1eae455a91f289e9bea081a (patch)
tree5b95aa3543197f4adb4fe99ea927aeb780ae2b1f
parent1339080a90a7a7344ae1da7003a380919d828ff0 (diff)
downloadvcpkg-4f80532991f5b9d4d1eae455a91f289e9bea081a.tar.gz
vcpkg-4f80532991f5b9d4d1eae455a91f289e9bea081a.zip
Place owns_command() in a separate cpp file
-rw-r--r--toolsrc/src/commands_other.cpp16
-rw-r--r--toolsrc/src/commands_owns.cpp23
-rw-r--r--toolsrc/vcpkg/vcpkg.vcxproj1
-rw-r--r--toolsrc/vcpkg/vcpkg.vcxproj.filters3
4 files changed, 27 insertions, 16 deletions
diff --git a/toolsrc/src/commands_other.cpp b/toolsrc/src/commands_other.cpp
index 2cafd5453..0c56e0f79 100644
--- a/toolsrc/src/commands_other.cpp
+++ b/toolsrc/src/commands_other.cpp
@@ -73,22 +73,6 @@ namespace vcpkg
exit(EXIT_SUCCESS);
}
- void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths)
- {
- args.check_max_args(1);
- if (args.command_arguments.size() == 0)
- {
- System::println(System::color::error, "Error: owns requires a pattern to search for as the first argument.");
- std::cout <<
- "example:\n"
- " vcpkg owns .dll\n";
- exit(EXIT_FAILURE);
- }
- StatusParagraphs status_db = database_load_check(paths);
- search_file(paths, args.command_arguments[0], status_db);
- exit(EXIT_SUCCESS);
- }
-
void internal_test_command(const vcpkg_cmd_arguments& /*args*/, const vcpkg_paths& /*paths*/)
{
// auto data = FormatEventData("test");
diff --git a/toolsrc/src/commands_owns.cpp b/toolsrc/src/commands_owns.cpp
new file mode 100644
index 000000000..1c54b35f7
--- /dev/null
+++ b/toolsrc/src/commands_owns.cpp
@@ -0,0 +1,23 @@
+#include "vcpkg_Commands.h"
+#include "vcpkg_System.h"
+#include "vcpkg.h"
+#include <iostream>
+
+namespace vcpkg
+{
+ void owns_command(const vcpkg_cmd_arguments& args, const vcpkg_paths& paths)
+ {
+ args.check_max_args(1);
+ if (args.command_arguments.size() == 0)
+ {
+ System::println(System::color::error, "Error: owns requires a pattern to search for as the first argument.");
+ std::cout <<
+ "example:\n"
+ " vcpkg owns .dll\n";
+ exit(EXIT_FAILURE);
+ }
+ StatusParagraphs status_db = database_load_check(paths);
+ search_file(paths, args.command_arguments[0], status_db);
+ exit(EXIT_SUCCESS);
+ }
+}
diff --git a/toolsrc/vcpkg/vcpkg.vcxproj b/toolsrc/vcpkg/vcpkg.vcxproj
index 475868b27..899ea2e5e 100644
--- a/toolsrc/vcpkg/vcpkg.vcxproj
+++ b/toolsrc/vcpkg/vcpkg.vcxproj
@@ -132,6 +132,7 @@
<ClCompile Include="..\src\commands_create.cpp" />
<ClCompile Include="..\src\commands_edit.cpp" />
<ClCompile Include="..\src\commands_list.cpp" />
+ <ClCompile Include="..\src\commands_owns.cpp" />
<ClCompile Include="..\src\commands_remove.cpp" />
<ClCompile Include="..\src\commands_search.cpp" />
<ClCompile Include="..\src\commands_update.cpp" />
diff --git a/toolsrc/vcpkg/vcpkg.vcxproj.filters b/toolsrc/vcpkg/vcpkg.vcxproj.filters
index 75ebc38e4..e31b53d6c 100644
--- a/toolsrc/vcpkg/vcpkg.vcxproj.filters
+++ b/toolsrc/vcpkg/vcpkg.vcxproj.filters
@@ -60,6 +60,9 @@
<ClCompile Include="..\src\commands_create.cpp">
<Filter>Source Files</Filter>
</ClCompile>
+ <ClCompile Include="..\src\commands_owns.cpp">
+ <Filter>Source Files</Filter>
+ </ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\post_build_lint.h">