~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/console/console.cc

  • Committer: Monty Taylor
  • Date: 2010-06-20 18:28:21 UTC
  • mto: (1626.1.2 build)
  • mto: This revision was merged to the branch mainline in revision 1633.
  • Revision ID: mordred@inaugust.com-20100620182821-oybk1tbpairic4oq
Added wrapper around variables_map to allow us to pull values back out of
variables map in the code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
18
18
#include <drizzled/plugin/listen_tcp.h>
19
19
#include <drizzled/plugin/client.h>
20
20
#include <drizzled/session.h>
 
21
#include <drizzled/module/option_map.h>
21
22
 
22
23
#include <iostream>
23
24
 
30
31
 
31
32
static bool enabled= false;
32
33
static bool debug_enabled= false;
33
 
static char* user = (char*)"";
34
 
static char* password = (char*)"";
35
 
static char* db = NULL;
 
34
static char* user= (char *)"";
 
35
static char* password= (char *)"";
 
36
static char* db= (char *)"";
36
37
 
37
38
 
38
39
class ClientConsole: public plugin::Client
316
317
 
317
318
static int init(drizzled::module::Context &context)
318
319
{
 
320
  const module::option_map &vm= context.getOptions();
 
321
  user= (char *)vm["user"].as<string>().c_str();
 
322
  password= (char *)vm["password"].as<string>().c_str();
 
323
  db= (char *)vm["db"].as<string>().c_str();
 
324
 
319
325
  listen_obj= new ListenConsole("console");
320
326
  context.add(listen_obj);
321
327
  return 0;
341
347
  context("debug",
342
348
          po::value<bool>(&debug_enabled)->default_value(false)->zero_tokens(),
343
349
          N_("Turn on extra debugging."));
 
350
  context("user",
 
351
          po::value<string>(),
 
352
          N_("User to use for auth."));
 
353
  context("password",
 
354
          po::value<string>(),
 
355
          N_("Password to use for auth."));
 
356
  context("db",
 
357
          po::value<string>(),
 
358
          N_("Default database to use."));
344
359
}
345
360
 
346
361
static drizzle_sys_var* vars[]= {