diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-02-08 15:24:59 -0800 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-02-08 15:24:59 -0800 |
| commit | 4d433302417d7e2b6478d731bc222847c2cd434a (patch) | |
| tree | 41c93a7ad44df67657cf8413fed745048579baf5 /toolsrc/src/commands_remove.cpp | |
| parent | 95af9aac7c39765d1524b7c9c39dc283e9f0facf (diff) | |
| parent | 2e94dfe97ca44dd78b3224321b5f9e06e6635854 (diff) | |
| download | vcpkg-4d433302417d7e2b6478d731bc222847c2cd434a.tar.gz vcpkg-4d433302417d7e2b6478d731bc222847c2cd434a.zip | |
Merge branch 'master' into codicodi-ninja-support
Diffstat (limited to 'toolsrc/src/commands_remove.cpp')
| -rw-r--r-- | toolsrc/src/commands_remove.cpp | 35 |
1 files changed, 19 insertions, 16 deletions
diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 7e8608e72..f49104d1e 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -196,26 +196,29 @@ namespace vcpkg::Commands::Remove for (const package_spec_with_remove_plan& action : remove_plan) { - if (action.plan.plan_type == remove_plan_type::NOT_INSTALLED) + const std::string display_name = action.spec.display_name(); + + switch (action.plan.plan_type) { - System::println(System::color::success, "Package %s is not installed", action.spec); + case remove_plan_type::NOT_INSTALLED: + System::println(System::color::success, "Package %s is not installed", display_name); + break; + case remove_plan_type::REMOVE: + System::println("Removing package %s... ", display_name); + remove_package(paths, action.spec, &status_db); + System::println(System::color::success, "Removing package %s... done", display_name); + break; + case remove_plan_type::UNKNOWN: + default: + Checks::unreachable(); } - else if (action.plan.plan_type == remove_plan_type::REMOVE) - { - const std::string display_name = action.spec.display_name(); - System::println("Removing package %s... ", display_name); - remove_package(paths, action.spec, &status_db); - System::println(System::color::success, "Removing package %s... done", display_name); - if (alsoRemoveFolderFromPackages) - { - System::println("Purging package %s... ", display_name); - delete_directory(paths.packages / action.spec.dir()); - System::println(System::color::success, "Purging package %s... done", display_name); - } + if (alsoRemoveFolderFromPackages) + { + System::println("Purging package %s... ", display_name); + delete_directory(paths.packages / action.spec.dir()); + System::println(System::color::success, "Purging package %s... done", display_name); } - else - Checks::unreachable(); } exit(EXIT_SUCCESS); |
