Replace usage of parse_all_args_as_package_specs with the new functions

This commit is contained in:
Alexander Karatarakis 2016-09-30 16:38:29 -07:00
parent df55e93b18
commit d7c357db2e
3 changed files with 5 additions and 5 deletions

View File

@ -7,14 +7,14 @@ namespace vcpkg
{
static const std::string example = create_example_string("edit zlib");
args.check_exact_arg_count(1, example.c_str());
package_spec spec = args.parse_all_arguments_as_package_specs(default_target_triplet, example.c_str()).at(0);
const package_spec spec = vcpkg_cmd_arguments::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example.c_str());
// Find editor
std::wstring env_EDITOR = System::wdupenv_str(L"EDITOR");
if (env_EDITOR.empty())
env_EDITOR = LR"(C:\Program Files (x86)\Microsoft VS Code\Code.exe)";
auto portpath = paths.ports / spec.name;
const fs::path portpath = paths.ports / spec.name;
std::wstring cmdLine = Strings::wformat(LR"("%s" "%s" "%s")", env_EDITOR, portpath.native(), (portpath / "portfile.cmake").native());
exit(System::cmd_execute(cmdLine));
}

View File

@ -69,7 +69,7 @@ namespace vcpkg
args.check_min_arg_count(1, example.c_str());
StatusParagraphs status_db = database_load_check(paths);
std::vector<package_spec> specs = args.parse_all_arguments_as_package_specs(default_target_triplet);
std::vector<package_spec> specs = vcpkg_cmd_arguments::check_and_get_package_specs(args.command_arguments, default_target_triplet, example.c_str());
std::vector<package_spec> install_plan = Dependencies::create_dependency_ordered_install_plan(paths, specs, status_db);
Checks::check_exit(!install_plan.empty(), "Install plan cannot be empty");
std::string specs_string = to_string(install_plan[0]);
@ -130,7 +130,7 @@ namespace vcpkg
args.check_exact_arg_count(1, example.c_str());
StatusParagraphs status_db = database_load_check(paths);
const package_spec spec = args.parse_all_arguments_as_package_specs(default_target_triplet).at(0);
const package_spec spec = vcpkg_cmd_arguments::check_and_get_package_spec(args.command_arguments.at(0), default_target_triplet, example.c_str());
std::unordered_set<package_spec> unmet_dependencies = Dependencies::find_unmet_dependencies(paths, spec, status_db);
if (!unmet_dependencies.empty())
{

View File

@ -28,7 +28,7 @@ namespace vcpkg
const std::unordered_set<std::string> options = args.check_and_get_optional_command_arguments({OPTION_PURGE});
auto status_db = database_load_check(paths);
std::vector<package_spec> specs = args.parse_all_arguments_as_package_specs(default_target_triplet);
std::vector<package_spec> specs = vcpkg_cmd_arguments::check_and_get_package_specs(args.command_arguments, default_target_triplet, example.c_str());
bool alsoRemoveFolderFromPackages = options.find(OPTION_PURGE) != options.end();
for (const package_spec& spec : specs)