summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSam Clegg <sbc@chromium.org>2022-08-04 13:26:16 -0700
committerGitHub <noreply@github.com>2022-08-04 13:26:16 -0700
commit1e6196f1b17e43bc78bb14264b376eb09161799c (patch)
tree3deae793f741050caec1ee2d6bb6b9ac25fd2886 /src
parent9c6849b6c53c216ba8656d68fd0fd99dca5e462c (diff)
downloadbinaryen-1e6196f1b17e43bc78bb14264b376eb09161799c.tar.gz
binaryen-1e6196f1b17e43bc78bb14264b376eb09161799c.tar.bz2
binaryen-1e6196f1b17e43bc78bb14264b376eb09161799c.zip
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 ```
Diffstat (limited to 'src')
-rw-r--r--src/support/command-line.cpp4
1 files changed, 4 insertions, 0 deletions
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",