Author: mysqlpp
Date: Sat Dec 29 04:08:01 2007
New Revision: 2053
URL: http://svn.gna.org/viewcvs/mysqlpp?rev=2053&view=rev
Log:
More verbose "connecting" message in resetdb, for debugging errors in
command line parameters.
Modified:
trunk/examples/resetdb.cpp
Modified: trunk/examples/resetdb.cpp
URL:
http://svn.gna.org/viewcvs/mysqlpp/trunk/examples/resetdb.cpp?rev=2053&r1=2052&r2=2053&view=diff
==============================================================================
--- trunk/examples/resetdb.cpp (original)
+++ trunk/examples/resetdb.cpp Sat Dec 29 04:08:01 2007
@@ -76,10 +76,15 @@
const char *server = 0, *user = 0, *pass = "";
mysqlpp::Connection con;
try {
- cout << "Connecting to database server..." << endl;
- if (!parse_command_line(argc, argv, 0, &server, &user, &pass) ||
- !con.connect(0, server, user, pass)) {
- return 1;
+ if (parse_command_line(argc, argv, 0, &server, &user, &pass)) {
+ cout << "Connecting to '" <<
+ (user ? user : "USERNAME") << "'@'" <<
+ (server ? server : "localhost") << "',
password '" <<
+ (pass ? pass : "") << "'..." << endl;
+ con.connect(0, server, user, pass);
+ }
+ else {
+ return 1; // command line parsing failed
}
}
catch (exception& er) {
_______________________________________________
Mysqlpp-commits mailing list
[email protected]
https://mail.gna.org/listinfo/mysqlpp-commits