Add z-ce command that passes through to ce blindly.
ADD
include/vcpkg/commands.zce.h
+#pragma once
+
+#include <vcpkg/commands.interface.h>
+
+namespace vcpkg::Commands
+{
+ struct ZCeCommand : PathsCommand
+ {
+ void perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const override;
+ };
+}

MODIFY
include/vcpkg/configure-environment.h
include/vcpkg/configure-environment.h
namespace vcpkg
{
+ int run_configure_environment_command(const VcpkgPaths& paths, View<std::string> args = {});
int run_configure_environment_command(const VcpkgPaths& paths, StringView arg0, View<std::string> args = {});
}

MODIFY
src/vcpkg/commands.cpp
src/vcpkg/commands.cpp
#include <vcpkg/commands.xdownload.h>
#include <vcpkg/commands.xvsinstances.h>
#include <vcpkg/commands.zbootstrap-readonly.h>
+#include <vcpkg/commands.zce.h>
#include <vcpkg/commands.zprintconfig.h>
#include <vcpkg/export.h>
#include <vcpkg/help.h>
@@ -96,30 +97,32 @@ namespace vcpkg::Commands
static const Search::SearchCommand search{};
static const Update::UpdateCommand update{};
static const X_VSInstances::VSInstancesCommand vsinstances{};
+ static const ZCeCommand ce{};
static std::vector<PackageNameAndFunction<const PathsCommand*>> t = {
{"/?", &help},
{"help", &help},
- {"new", &new_},
- {"search", &search},
- {"list", &list},
+ {"activate", &activate},
+ {"autocomplete", &autocomplete},
+ {"cache", &cache},
+ {"create", &create},
+ {"edit", &edit},
+ {"fetch", &fetch},
+ {"format-manifest", &format_manifest},
{"integrate", &integrate},
+ {"list", &list},
+ {"new", &new_},
{"owns", &owns},
- {"update", &update},
- {"edit", &edit},
- {"create", &create},
- {"cache", &cache},
{"portsdiff", &portsdiff},
- {"autocomplete", &autocomplete},
- {"fetch", &fetch},
+ {"search", &search},
+ {"update", &update},
+ {"x-add-version", &add_version},
{"x-ci-clean", &ciclean},
- {"x-package-info", &info},
+ {"x-ci-verify-versions", &ci_verify_versions},
{"x-history", &porthistory},
+ {"x-package-info", &info},
{"x-vsinstances", &vsinstances},
- {"format-manifest", &format_manifest},
- {"x-ci-verify-versions", &ci_verify_versions},
- {"x-add-version", &add_version},
- {"activate", &activate},
+ {"z-ce", &ce},
};
return t;
}

ADD
src/vcpkg/commands.zce.cpp
+#include <vcpkg/base/basic_checks.h>
+
+#include <vcpkg/commands.zce.h>
+#include <vcpkg/configure-environment.h>
+#include <vcpkg/vcpkgcmdarguments.h>
+
+namespace vcpkg::Commands
+{
+ void ZCeCommand::perform_and_exit(const VcpkgCmdArguments& args, const VcpkgPaths& paths) const
+ {
+ Checks::exit_with_code(VCPKG_LINE_INFO,
+ run_configure_environment_command(paths, args.get_forwardable_arguments()));
+ }
+}

MODIFY
src/vcpkg/configure-environment.cpp
src/vcpkg/configure-environment.cpp
namespace vcpkg
{
- int run_configure_environment_command(const VcpkgPaths& paths, StringView arg0, View<std::string> args)
+ int run_configure_environment_command(const VcpkgPaths& paths, View<std::string> args)
{
print2(Color::warning, "vcpkg-ce ('configure environment') is experimental and may change at any time.\n");
@@ -60,11 +60,17 @@ namespace vcpkg
Command cmd_run(node_path);
cmd_run.string_arg("--harmony");
cmd_run.string_arg(ce_path);
- cmd_run.string_arg("--accept-eula");
- cmd_run.string_arg(arg0);
cmd_run.forwarded_args(args);
- // tell vcpkg-ce that it's being called from vcpkg
cmd_run.string_arg("--from-vcpkg");
return cmd_execute(cmd_run, InWorkingDirectory{paths.original_cwd});
}
+
+ int run_configure_environment_command(const VcpkgPaths& paths, StringView arg0, View<std::string> args)
+ {
+ std::vector<std::string> all_args;
+ all_args.reserve(args.size() + 1);
+ all_args.emplace_back(arg0.data(), arg0.size());
+ all_args.insert(all_args.end(), args.begin(), args.end());
+ return run_configure_environment_command(paths, all_args);
+ }
}

Add z-ce command that passes through to ce blindly.