diff options
| author | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-05 14:20:49 -0700 |
|---|---|---|
| committer | Alexander Karatarakis <alkarata@microsoft.com> | 2017-04-05 14:20:49 -0700 |
| commit | 84ed16743988051b2e41cb5c66409370e6a6d5fe (patch) | |
| tree | 21786223238b20b159ecce8d866dfb76ab91348b /toolsrc/src/commands_depends.cpp | |
| parent | cf44582b9f234df47f0fc6347d06d0302a3f65da (diff) | |
| download | vcpkg-84ed16743988051b2e41cb5c66409370e6a6d5fe.tar.gz vcpkg-84ed16743988051b2e41cb5c66409370e6a6d5fe.zip | |
Introduce `vcpkg depend-info` command
Diffstat (limited to 'toolsrc/src/commands_depends.cpp')
| -rw-r--r-- | toolsrc/src/commands_depends.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/toolsrc/src/commands_depends.cpp b/toolsrc/src/commands_depends.cpp new file mode 100644 index 000000000..a61ac534e --- /dev/null +++ b/toolsrc/src/commands_depends.cpp @@ -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); + } +} |
