Introduce vcpkg depend-info command

This commit is contained in:
Alexander Karatarakis 2017-04-05 14:20:49 -07:00
parent cf44582b9f
commit 84ed167439
5 changed files with 35 additions and 0 deletions

View File

@ -86,6 +86,11 @@ namespace vcpkg::Commands
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace DependInfo
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);
}
namespace Search
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths);

View File

@ -26,6 +26,7 @@ namespace vcpkg::Commands
{"integrate", &Integrate::perform_and_exit},
{"owns", &Owns::perform_and_exit},
{"update", &Update::perform_and_exit},
{"depend-info", &DependInfo::perform_and_exit},
{"edit", &Edit::perform_and_exit},
{"create", &Create::perform_and_exit},
{"import", &Import::perform_and_exit},

View File

@ -0,0 +1,25 @@
#include "pch.h"
#include "vcpkg_Commands.h"
#include "vcpkg_System.h"
#include "Paragraphs.h"
#include "vcpkg_Strings.h"
namespace vcpkg::Commands::DependInfo
{
void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths)
{
static const std::string example = Commands::Help::create_example_string(R"###(depend-info)###");
args.check_exact_arg_count(0, example);
args.check_and_get_optional_command_arguments({});
const std::vector<SourceParagraph> source_paragraphs = Paragraphs::load_all_ports(paths.ports);
for (const SourceParagraph& source_paragraph : source_paragraphs)
{
auto s = Strings::join(", ", source_paragraph.depends, [](const Dependency& d) { return d.name; });
System::println("%s: %s", source_paragraph.name, s);
}
Checks::exit_success(VCPKG_LINE_INFO);
}
}

View File

@ -185,6 +185,7 @@
<ClCompile Include="..\include\VersionT.cpp" />
<ClCompile Include="..\src\BinaryParagraph.cpp" />
<ClCompile Include="..\src\commands_ci.cpp" />
<ClCompile Include="..\src\commands_depends.cpp" />
<ClCompile Include="..\src\commands_env.cpp" />
<ClCompile Include="..\src\LineInfo.cpp" />
<ClCompile Include="..\src\ParagraphParseResult.cpp" />

View File

@ -180,6 +180,9 @@
<ClCompile Include="..\src\VcpkgPaths.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\src\commands_depends.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\include\SourceParagraph.h">