Skip to content

Commit

Permalink
Fix for ticket #184. Also includes some tweaks to resolve some
Browse files Browse the repository at this point in the history
compiler warnings, and to avoid flushing cout unnecessarily.


git-svn-id: http://svn.osgeo.org/qgis/trunk@5587 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jul 12, 2006
1 parent 863c74a commit 53bd594
Showing 1 changed file with 23 additions and 23 deletions.
46 changes: 23 additions & 23 deletions tools/qgis_config/qgis_config.cpp
Expand Up @@ -68,17 +68,17 @@ int main(int argc, char **argv)
{"cflags", no_argument, 0, 'c'},
{"libs", no_argument, 0, 'l'},
{"plugindir", no_argument, 0, 'w'},
{"major_version", no_argument, 0, 'v1'},
{"minor_version", no_argument, 0, 'v2'},
{"micro_version", no_argument, 0, 'v3'},
{"extra_version", no_argument, 0, 'v4'},
{"major_version", no_argument, 0, '1'},
{"minor_version", no_argument, 0, '2'},
{"micro_version", no_argument, 0, '3'},
{"extra_version", no_argument, 0, '4'},
{0, 0, 0, 0}
};
// If no argument is given, show hint
if(argc == 1)
{
std::cout << "qgis_config: argument required" << std::endl;
std::cout << "Try \"qgis_config --help\" for more information." << std::endl;
std::cout << "qgis_config: argument required\n"
<< "Try \"qgis_config --help\" for more information.\n";
}else
{
// One or more arguments supplied
Expand All @@ -97,41 +97,42 @@ int main(int argc, char **argv)
switch (optionChar)
{
case 'p':
std::cout << PREFIX << std::endl;
std::cout << PREFIX << '\n';
break;

case 'b':
std::cout << BIN_DIR << std::endl;
std::cout << BIN_DIR << '\n';
break;

case 'c':
std::cout << "-I" << INCLUDE_DIR << " ";
std::cout << "-I" << INCLUDE_DIR << "/qgis" << std::endl;
std::cout << "-I" << INCLUDE_DIR << " "
<< "-I" << INCLUDE_DIR << "/qgis\n";
break;

case 'l':
std::cout << "-L" << LIB_DIR << " ";
std::cout << " -lqgis" << std::endl;
std::cout << "-L" << LIB_DIR
<< " -lqgis_core -lqgis_gui -lqgis_composer"
<< " -lqgisgrass -lqgis_legend -lqgis_raster\n";
break;

case 'w':
std::cout << PLUGIN_DIR << std::endl;
std::cout << PLUGIN_DIR << '\n';
break;

case 'v1':
std::cout << MAJOR_VERSION << std::endl;
case '1':
std::cout << MAJOR_VERSION << '\n';
break;

case 'v2':
std::cout << MINOR_VERSION << std::endl;
case '2':
std::cout << MINOR_VERSION << '\n';
break;

case 'v3':
std::cout << MICRO_VERSION << std::endl;
case '3':
std::cout << MICRO_VERSION << '\n';
break;

case 'v4':
std::cout << EXTRA_VERSION << std::endl;
case '4':
std::cout << EXTRA_VERSION << '\n';
break;

case 'h':
Expand All @@ -140,8 +141,7 @@ int main(int argc, char **argv)
break;

default:
std::cout << "Try \"qgis_config --help\" for more information."
<< std::endl;
std::cout << "Try \"qgis_config --help\" for more information.\n";
return 1;
}
}
Expand Down

0 comments on commit 53bd594

Please sign in to comment.