From 1e6196f1b17e43bc78bb14264b376eb09161799c Mon Sep 17 00:00:00 2001 From: Sam Clegg Date: Thu, 4 Aug 2022 13:26:16 -0700 Subject: Allow `BINARYEN_DEBUG` environment variable to be used in place of `--debug`. NFC (#4874) For example I found it useful to able to do something like this: ``` $ BINARYEN_DEBUG=post-emscripten ./test/runner sometest ``` --- src/support/command-line.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/support/command-line.cpp b/src/support/command-line.cpp index 0147f9044..23ded0346 100644 --- a/src/support/command-line.cpp +++ b/src/support/command-line.cpp @@ -55,6 +55,10 @@ Options::Options(const std::string& command, const std::string& description) : debug(false), positional(Arguments::Zero) { std::string GeneralOption = "General options"; + if (getenv("BINARYEN_DEBUG")) { + setDebugEnabled(getenv("BINARYEN_DEBUG")); + } + add("--version", "", "Output version information and exit", -- cgit v1.2.3