diff --git a/src/vcpkg/commands.depend-info.cpp b/src/vcpkg/commands.depend-info.cpp index 0bfbadd975..6901930946 100644 --- a/src/vcpkg/commands.depend-info.cpp +++ b/src/vcpkg/commands.depend-info.cpp @@ -165,6 +165,18 @@ namespace namespace vcpkg { + namespace + { + const char* get_dot_element_style(const std::string& label) + { + if (!Strings::contains(label, ':')) return ""; + + if (Strings::ends_with(label, ":host")) return " [color=gray51 fontcolor=gray51]"; + + return " [color=blue fontcolor=blue]"; + } + } + std::string create_dot_as_string(const std::vector& depend_info) { int empty_node_count = 0; @@ -173,7 +185,8 @@ namespace vcpkg for (const auto& package : depend_info) { - fmt::format_to(std::back_inserter(s), "\"{}\";\n", package.package); + fmt::format_to( + std::back_inserter(s), "\"{}\"{};\n", package.package, get_dot_element_style(package.package)); if (package.dependencies.empty()) { empty_node_count++; @@ -182,7 +195,8 @@ namespace vcpkg for (const auto& d : package.dependencies) { - fmt::format_to(std::back_inserter(s), "\"{}\" -> \"{}\";\n", package.package, d); + fmt::format_to( + std::back_inserter(s), "\"{}\" -> \"{}\"{};\n", package.package, d, get_dot_element_style(d)); } }