diff options
author | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-11-11 05:51:10 +0800 |
---|---|---|
committer | Marek Kotewicz <marek.kotewicz@gmail.com> | 2014-11-11 05:51:10 +0800 |
commit | a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2 (patch) | |
tree | c3095ab40b8ca70d861fedcf9d63353e9cb2f46b | |
parent | 8c384232eb6c729021a5bd89bd2eccea7c2af34c (diff) | |
download | dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar.gz dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar.bz2 dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar.lz dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar.xz dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.tar.zst dexon-solidity-a44bd8c987aa4921db4ace42d4dd5357eb9e2ac2.zip |
merge
-rw-r--r-- | main.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -42,7 +42,8 @@ void help() { cout << "Usage solc [OPTIONS] <file>" << endl << "Options:" << endl - << " -h,--help Show this help message and exit." << endl + << " -o,--optimize Optimize the bytecode for size." << endl + << " -h,--help Show this help message and exit." << endl << " -V,--version Show the version and exit." << endl; exit(0); } @@ -58,10 +59,13 @@ void version() int main(int argc, char** argv) { string infile; + bool optimize = false; for (int i = 1; i < argc; ++i) { string arg = argv[i]; - if (arg == "-h" || arg == "--help") + if (arg == "-o" || arg == "--optimize") + optimize = true; + else if (arg == "-h" || arg == "--help") help(); else if (arg == "-V" || arg == "--version") version(); @@ -98,7 +102,7 @@ int main(int argc, char** argv) printer.print(cout); compiler.compileContract(*ast); - instructions = compiler.getAssembledBytecode(); + instructions = compiler.getAssembledBytecode(optimize); } catch (ParserError const& exception) { |