diff options
author | Jose <jose@zeroc.com> | 2017-02-01 23:16:30 +0100 |
---|---|---|
committer | Jose <jose@zeroc.com> | 2017-02-01 23:16:30 +0100 |
commit | ca131951f8d81ea3da13277172a24234b5c848ea (patch) | |
tree | 28b8d9ad6a09f550ef43f3b24df8048da8e70d7d /cpp/src/slice2js/Main.cpp | |
parent | Added entries for support of try-with-resources/with statement in Java/Python (diff) | |
download | ice-ca131951f8d81ea3da13277172a24234b5c848ea.tar.bz2 ice-ca131951f8d81ea3da13277172a24234b5c848ea.tar.xz ice-ca131951f8d81ea3da13277172a24234b5c848ea.zip |
Add --no-warn option to Slice compilers
Diffstat (limited to 'cpp/src/slice2js/Main.cpp')
-rw-r--r-- | cpp/src/slice2js/Main.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/cpp/src/slice2js/Main.cpp b/cpp/src/slice2js/Main.cpp index a73738fcee9..03f17331e59 100644 --- a/cpp/src/slice2js/Main.cpp +++ b/cpp/src/slice2js/Main.cpp @@ -80,6 +80,7 @@ usage(const string& n) " deprecated: use instead [[\"ice-prefix\"]] metadata.\n" "--underscore Allow underscores in Slice identifiers\n" " deprecated: use instead [[\"underscore\"]] metadata.\n" + "--no-warn Disable all warnings.\n" ; } @@ -103,6 +104,7 @@ compile(const vector<string>& argv) opts.addOpt("d", "debug"); opts.addOpt("", "ice"); opts.addOpt("", "underscore"); + opts.addOpt("", "no-warn"); bool validate = find(argv.begin(), argv.end(), "--validate") != argv.end(); @@ -172,6 +174,8 @@ compile(const vector<string>& argv) bool underscore = opts.isSet("underscore"); + int warningLevel = opts.isSet("no-warn") ? 0 : 1; + if(args.empty()) { consoleErr << argv[0] << ": error: no input file" << endl; @@ -335,12 +339,12 @@ compile(const vector<string>& argv) { if(useStdout) { - Gen gen(icecpp->getBaseName(), includePaths, output, cout); + Gen gen(icecpp->getBaseName(), includePaths, output, cout, warningLevel); gen.generate(p); } else { - Gen gen(icecpp->getBaseName(), includePaths, output); + Gen gen(icecpp->getBaseName(), includePaths, output, warningLevel); gen.generate(p); } } |