Place owns_command() in a separate cpp file

This commit is contained in:
Alexander Karatarakis 2016-09-22 00:06:37 -07:00
parent 1339080a90
commit 4f80532991
4 changed files with 27 additions and 16 deletions

View File

@ -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");

View File

@ -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);
}
}

View File

@ -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" />

View File

@ -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">