mirror of
https://github.com/microsoft/vcpkg.git
synced 2025-01-15 04:28:01 +08:00
Place owns_command() in a separate cpp file
This commit is contained in:
parent
1339080a90
commit
4f80532991
@ -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");
|
||||
|
23
toolsrc/src/commands_owns.cpp
Normal file
23
toolsrc/src/commands_owns.cpp
Normal 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);
|
||||
}
|
||||
}
|
@ -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" />
|
||||
|
@ -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">
|
||||
|
Loading…
x
Reference in New Issue
Block a user