diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-10-12 11:22:25 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-10-12 11:22:25 -0700 |
| commit | 85e6b1b36e734c0db50464b07b77589d63c3c875 (patch) | |
| tree | 095289838517a64f06298b1a05ded47a7139d7d9 /toolsrc/src/commands_portsdiff.cpp | |
| parent | d7a313c5c356e1641f18cd14ad0ac0c3901bc0bf (diff) | |
| parent | 9c3f9582fb4541a59e4282269e4f6c9c7debcc3e (diff) | |
| download | vcpkg-85e6b1b36e734c0db50464b07b77589d63c3c875.tar.gz vcpkg-85e6b1b36e734c0db50464b07b77589d63c3c875.zip | |
Merge branch 'master' into vtk-components
Diffstat (limited to 'toolsrc/src/commands_portsdiff.cpp')
| -rw-r--r-- | toolsrc/src/commands_portsdiff.cpp | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/toolsrc/src/commands_portsdiff.cpp b/toolsrc/src/commands_portsdiff.cpp index 83d62896f..2334b2270 100644 --- a/toolsrc/src/commands_portsdiff.cpp +++ b/toolsrc/src/commands_portsdiff.cpp @@ -2,7 +2,6 @@ #include "Paragraphs.h" #include "SortedVector.h" -#include "SourceParagraph.h" #include "vcpkg_Commands.h" #include "vcpkg_Maps.h" #include "vcpkg_System.h" @@ -69,7 +68,7 @@ namespace vcpkg::Commands::PortsDiff for (const std::string& name : ports_to_print) { const VersionT& version = names_and_versions.at(name); - System::println("%-20s %-16s", name, version); + System::println(" - %-14s %-16s", name, version); } } @@ -117,11 +116,11 @@ namespace vcpkg::Commands::PortsDiff void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) { - static const std::string example = + static const std::string EXAMPLE = Strings::format("The argument should be a branch/tag/hash to checkout.\n%s", Commands::Help::create_example_string("portsdiff mybranchname")); - args.check_min_arg_count(1, example); - args.check_max_arg_count(2, example); + args.check_min_arg_count(1, EXAMPLE); + args.check_max_arg_count(2, EXAMPLE); args.check_and_get_optional_command_arguments({}); const fs::path& git_exe = paths.get_git_exe(); @@ -139,8 +138,8 @@ namespace vcpkg::Commands::PortsDiff read_ports_from_commit(paths, git_commit_id_for_previous_snapshot); // Already sorted, so set_difference can work on std::vector too - std::vector<std::string> current_ports = Maps::extract_keys(current_names_and_versions); - std::vector<std::string> previous_ports = Maps::extract_keys(previous_names_and_versions); + const std::vector<std::string> current_ports = Maps::extract_keys(current_names_and_versions); + const std::vector<std::string> previous_ports = Maps::extract_keys(previous_names_and_versions); const SetElementPresence<std::string> setp = SetElementPresence<std::string>::create(current_ports, previous_ports); @@ -148,14 +147,14 @@ namespace vcpkg::Commands::PortsDiff const std::vector<std::string>& added_ports = setp.only_left; if (!added_ports.empty()) { - System::println("\nThe following %d ports were added:\n", added_ports.size()); + System::println("\nThe following %d ports were added:", added_ports.size()); do_print_name_and_version(added_ports, current_names_and_versions); } const std::vector<std::string>& removed_ports = setp.only_right; if (!removed_ports.empty()) { - System::println("\nThe following %d ports were removed:\n", removed_ports.size()); + System::println("\nThe following %d ports were removed:", removed_ports.size()); do_print_name_and_version(removed_ports, previous_names_and_versions); } @@ -165,10 +164,10 @@ namespace vcpkg::Commands::PortsDiff if (!updated_ports.empty()) { - System::println("\nThe following %d ports were updated:\n", updated_ports.size()); + System::println("\nThe following %d ports were updated:", updated_ports.size()); for (const UpdatedPort& p : updated_ports) { - System::println("%-20s %-16s", p.port, p.version_diff.to_string()); + System::println(" - %-14s %-16s", p.port, p.version_diff.to_string()); } } |
