From 289f67db5e2b35767fd0e925c474ed001b49033f Mon Sep 17 00:00:00 2001 From: Michi Henning Date: Tue, 7 Nov 2006 04:29:20 +0000 Subject: Fixed a few coding style issues. --- cpp/src/slice2cppe/Main.cpp | 79 ++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 48 deletions(-) (limited to 'cpp/src/slice2cppe/Main.cpp') diff --git a/cpp/src/slice2cppe/Main.cpp b/cpp/src/slice2cppe/Main.cpp index cda1051a7b7..f015f8a88b3 100644 --- a/cpp/src/slice2cppe/Main.cpp +++ b/cpp/src/slice2cppe/Main.cpp @@ -44,18 +44,6 @@ usage(const char* n) int main(int argc, char* argv[]) { - string cppArgs; - vector includePaths; - bool preprocess; - string include; - string output; - string dllExport; - bool impl; - bool depend; - bool debug; - bool ice; - bool caseSensitive; - IceUtil::Options opts; opts.addOpt("h", "help"); opts.addOpt("v", "version"); @@ -92,6 +80,7 @@ main(int argc, char* argv[]) usage(argv[0]); return EXIT_SUCCESS; } + if(opts.isSet("version")) { cout << ICEE_STRING_VERSION << endl; @@ -103,48 +92,42 @@ main(int argc, char* argv[]) vectorextraHeaders = opts.argVec("add-header"); - if(opts.isSet("D")) - { - vector optargs = opts.argVec("D"); - for(vector::const_iterator i = optargs.begin(); i != optargs.end(); ++i) - { - cppArgs += " -D\"" + *i + "\""; - } - } - if(opts.isSet("U")) - { - vector optargs = opts.argVec("U"); - for(vector::const_iterator i = optargs.begin(); i != optargs.end(); ++i) - { - cppArgs += " -U\"" + *i + "\""; - } - } - if(opts.isSet("I")) - { - includePaths = opts.argVec("I"); - for(vector::const_iterator i = includePaths.begin(); i != includePaths.end(); ++i) - { - cppArgs += " -I\"" + *i + "\""; - } - } - preprocess = opts.isSet("E"); - if(opts.isSet("include-dir")) + string cppArgs; + vector optargs = opts.argVec("D"); + for(vector::const_iterator i = optargs.begin(); i != optargs.end(); ++i) { - include = opts.optArg("include-dir"); + cppArgs += " -D\"" + *i + "\""; } - if(opts.isSet("output-dir")) + + optargs = opts.argVec("U"); + for(vector::const_iterator i = optargs.begin(); i != optargs.end(); ++i) { - output = opts.optArg("output-dir"); + cppArgs += " -U\"" + *i + "\""; } - if(opts.isSet("dll-export")) + + vector includePaths = opts.argVec("I"); + for(vector::const_iterator i = includePaths.begin(); i != includePaths.end(); ++i) { - dllExport = opts.optArg("dll-export"); + cppArgs += " -I\"" + *i + "\""; } - impl = opts.isSet("impl"); - depend = opts.isSet("depend"); - debug = opts.isSet("debug"); - ice = opts.isSet("ice"); - caseSensitive = opts.isSet("case-sensitive"); + + bool preprocess = opts.isSet("E"); + + string include = opts.optArg("include-dir"); + + string output = opts.optArg("output-dir"); + + string dllExport = opts.optArg("dll-export"); + + bool impl = opts.isSet("impl"); + + bool depend = opts.isSet("depend"); + + bool debug = opts.isSet("debug"); + + bool ice = opts.isSet("ice"); + + bool caseSensitive = opts.isSet("case-sensitive"); if(args.empty()) { -- cgit v1.2.3