mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 03:11:38 +08:00
Introduce vcpkg depend-info
command
This commit is contained in:
parent
cf44582b9f
commit
84ed167439
@ -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);
|
||||
|
@ -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},
|
||||
|
25
toolsrc/src/commands_depends.cpp
Normal file
25
toolsrc/src/commands_depends.cpp
Normal 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);
|
||||
}
|
||||
}
|
@ -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" />
|
||||
|
@ -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">
|
||||
|
Loading…
Reference in New Issue
Block a user