~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to client/drizzle.cc

  • Committer: Mark Atwood
  • Date: 2011-06-10 07:17:06 UTC
  • mfrom: (2281.7.9 trunk-bug-743902)
  • Revision ID: me@mark.atwood.name-20110610071706-u1ezbs37euuyqrx9
mergeĀ lp:~linuxjedi/drizzle/trunk-bug-743902

Show diffs side-by-side

added added

removed removed

Lines of Context:
154
154
#include <boost/scoped_ptr.hpp>
155
155
#include <drizzled/program_options/config_file.h>
156
156
 
 
157
#include "user_detect.h"
 
158
 
157
159
using namespace std;
158
160
namespace po=boost::program_options;
159
161
namespace dpo=drizzled::program_options;
1471
1473
  ("max-join-size", po::value<uint32_t>(&max_join_size)->default_value(1000000L),
1472
1474
  _("Automatic limit for rows in a join when using --safe-updates"))
1473
1475
  ;
1474
 
  const char* unix_user= getlogin();
 
1476
  UserDetect detected_user;
 
1477
  const char* shell_user= detected_user.getUser();
1475
1478
  po::options_description client_options(_("Options specific to the client"));
1476
1479
  client_options.add_options()
1477
1480
  ("host,h", po::value<string>(&current_host)->default_value("localhost"),
1480
1483
  _("Password to use when connecting to server. If password is not given it's asked from the tty."))
1481
1484
  ("port,p", po::value<uint32_t>()->default_value(0),
1482
1485
  _("Port number to use for connection or 0 for default to, in order of preference, drizzle.cnf, $DRIZZLE_TCP_PORT, built-in default"))
1483
 
  ("user,u", po::value<string>(&current_user)->default_value((unix_user ? unix_user : "")),
 
1486
  ("user,u", po::value<string>(&current_user)->default_value(shell_user ? shell_user : ""),
1484
1487
  _("User for login if not current user."))
1485
1488
  ("protocol",po::value<string>(&opt_protocol)->default_value("mysql"),
1486
1489
  _("The protocol of connection (mysql, mysql-plugin-auth, or drizzle)."))
1487
1490
  ;
1488
 
 
1489
1491
  po::options_description long_options(_("Allowed Options"));
1490
1492
  long_options.add(commandline_options).add(drizzle_options).add(client_options);
1491
1493