diff options
| author | Robert Schumacher <roschuma@microsoft.com> | 2017-04-01 01:09:34 -0700 |
|---|---|---|
| committer | Robert Schumacher <roschuma@microsoft.com> | 2017-04-01 01:11:51 -0700 |
| commit | 74f788d04f2ff8ce66302b6be401ec9b7e85a42f (patch) | |
| tree | 248492633c926e8046e7a1610607209758f48bdd /toolsrc/src/commands_remove.cpp | |
| parent | 74fbd3acd5d2128e94dad2a0a5f705e93bb49e9a (diff) | |
| download | vcpkg-74f788d04f2ff8ce66302b6be401ec9b7e85a42f.tar.gz vcpkg-74f788d04f2ff8ce66302b6be401ec9b7e85a42f.zip | |
[vcpkg] Replace explicit bulk operations with fmap
Diffstat (limited to 'toolsrc/src/commands_remove.cpp')
| -rw-r--r-- | toolsrc/src/commands_remove.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/toolsrc/src/commands_remove.cpp b/toolsrc/src/commands_remove.cpp index 9f4c76b11..a0f846470 100644 --- a/toolsrc/src/commands_remove.cpp +++ b/toolsrc/src/commands_remove.cpp @@ -4,6 +4,7 @@ #include "vcpkg_System.h" #include "vcpkg_Input.h" #include "vcpkg_Dependencies.h" +#include "vcpkg_Util.h" namespace vcpkg::Commands::Remove { @@ -168,8 +169,14 @@ namespace vcpkg::Commands::Remove { static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost"); args.check_min_arg_count(1, example); - std::vector<package_spec> specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example); - Input::check_triplets(specs, paths); + + auto specs = Util::fmap(args.command_arguments, [&](auto&& arg) + { + auto spec = Input::check_and_get_package_spec(arg, default_target_triplet, example); + Input::check_triplet(spec.target_triplet(), paths); + return spec; + }); + const std::unordered_set<std::string> options = args.check_and_get_optional_command_arguments({ OPTION_PURGE, OPTION_RECURSE, OPTION_DRY_RUN }); const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end(); const bool isRecursive = options.find(OPTION_RECURSE) != options.end(); |
