diff options
Diffstat (limited to 'src/support/command-line.cpp')
-rw-r--r-- | src/support/command-line.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/support/command-line.cpp b/src/support/command-line.cpp index f1b4fca4d..be5098677 100644 --- a/src/support/command-line.cpp +++ b/src/support/command-line.cpp @@ -15,6 +15,7 @@ */ #include "support/command-line.h" +#include "config.h" using namespace wasm; @@ -51,6 +52,14 @@ void printWrap(std::ostream& os, int leftPad, const std::string& content) { Options::Options(const std::string& command, const std::string& description) : debug(false), positional(Arguments::Zero) { + add("--version", + "", + "Output version information and exit", + Arguments::Zero, + [command](Options*, const std::string&) { + std::cout << command << " " << BINARYEN_VERSION_INFO << "\n"; + exit(0); + }); add("--help", "-h", "Show this help message and exit", |