mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-11-29 19:39:06 +08:00
[remove-command] Reorder input processing
This commit is contained in:
parent
6d2b407b28
commit
c1a2c79b6b
@ -167,15 +167,13 @@ namespace vcpkg::Commands::Remove
|
|||||||
{
|
{
|
||||||
static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost");
|
static const std::string example = Commands::Help::create_example_string("remove zlib zlib:x64-windows curl boost");
|
||||||
args.check_min_arg_count(1, example);
|
args.check_min_arg_count(1, example);
|
||||||
|
|
||||||
const std::unordered_set<std::string> options = args.check_and_get_optional_command_arguments({OPTION_PURGE, OPTION_RECURSE});
|
|
||||||
auto status_db = database_load_check(paths);
|
|
||||||
|
|
||||||
std::vector<package_spec> specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example);
|
std::vector<package_spec> specs = Input::check_and_get_package_specs(args.command_arguments, default_target_triplet, example);
|
||||||
Input::check_triplets(specs, paths);
|
Input::check_triplets(specs, paths);
|
||||||
|
const std::unordered_set<std::string> options = args.check_and_get_optional_command_arguments({ OPTION_PURGE, OPTION_RECURSE });
|
||||||
const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end();
|
const bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end();
|
||||||
const bool isRecursive = options.find(OPTION_RECURSE) != options.end();
|
const bool isRecursive = options.find(OPTION_RECURSE) != options.end();
|
||||||
|
|
||||||
|
auto status_db = database_load_check(paths);
|
||||||
const std::vector<package_spec_with_remove_plan> remove_plan = Dependencies::create_remove_plan(specs, status_db);
|
const std::vector<package_spec_with_remove_plan> remove_plan = Dependencies::create_remove_plan(specs, status_db);
|
||||||
Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty");
|
Checks::check_exit(!remove_plan.empty(), "Remove plan cannot be empty");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user