aboutsummaryrefslogtreecommitdiff
path: root/toolsrc/src
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2018-04-03 15:28:47 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2018-04-03 15:28:47 -0700
commit385df0b02b204e01fbe49c8e3d24c093b22db4b2 (patch)
tree66eccba17add05bf3a9ff9b4789068214d6a9489 /toolsrc/src
parent410c547fa14ba6197833f19f2180ba2c532c1722 (diff)
downloadvcpkg-385df0b02b204e01fbe49c8e3d24c093b22db4b2.tar.gz
vcpkg-385df0b02b204e01fbe49c8e3d24c093b22db4b2.zip
Add vcpkg edit --all
Diffstat (limited to 'toolsrc/src')
-rw-r--r--toolsrc/src/vcpkg/commands.edit.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/toolsrc/src/vcpkg/commands.edit.cpp b/toolsrc/src/vcpkg/commands.edit.cpp
index ac34a6720..94df9f9af 100644
--- a/toolsrc/src/vcpkg/commands.edit.cpp
+++ b/toolsrc/src/vcpkg/commands.edit.cpp
@@ -34,6 +34,8 @@ namespace vcpkg::Commands::Edit
static constexpr StringLiteral OPTION_BUILDTREES = "--buildtrees";
+ static constexpr StringLiteral OPTION_ALL = "--all";
+
static std::vector<std::string> valid_arguments(const VcpkgPaths& paths)
{
auto sources_and_errors = Paragraphs::try_load_all_ports(paths.get_filesystem(), paths.ports);
@@ -42,9 +44,9 @@ namespace vcpkg::Commands::Edit
[](auto&& pgh) -> std::string { return pgh->core_paragraph->name; });
}
- static constexpr std::array<CommandSwitch, 1> EDIT_SWITCHES = {{
- {OPTION_BUILDTREES, "Open editor into the port-specific buildtree subfolder"},
- }};
+ static constexpr std::array<CommandSwitch, 2> EDIT_SWITCHES = {
+ {{OPTION_BUILDTREES, "Open editor into the port-specific buildtree subfolder"},
+ {OPTION_ALL, "Open editor into the port as well as the port-specific buildtree subfolder"}}};
const CommandStructure COMMAND_STRUCTURE = {
Help::create_example_string("edit zlib"),
@@ -113,6 +115,15 @@ namespace vcpkg::Commands::Edit
Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmd_line));
}
+ if (Util::Sets::contains(options.switches, OPTION_ALL))
+ {
+ const auto buildtrees_current_dir = paths.buildtrees / port_name;
+
+ const auto cmd_line = Strings::format(
+ R"("%s" "%s" %s -n)", env_editor.u8string(), portpath.u8string(), buildtrees_current_dir.u8string());
+ Checks::exit_with_code(VCPKG_LINE_INFO, System::cmd_execute(cmd_line));
+ }
+
const auto cmd_line = Strings::format(
R"("%s" "%s" "%s" -n)",
env_editor.u8string(),