~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to plugin/console/console.cc

  • Committer: Monty Taylor
  • Date: 2010-06-19 21:25:32 UTC
  • mfrom: (1627.2.5 build)
  • Revision ID: mordred@inaugust.com-20100619212532-2e4bd11tm4plya7q
Rollup patch featuring: boost::program_options support for plugins, a
valgrind fix, a bugfix for password processing and a few build fixes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
 
22
22
#include <iostream>
23
23
 
 
24
#include <boost/program_options.hpp>
 
25
 
24
26
using namespace std;
25
27
using namespace drizzled;
26
28
 
 
29
namespace po= boost::program_options;
 
30
 
27
31
static bool enabled= false;
28
32
static bool debug_enabled= false;
29
33
static char* user = (char*)"";
319
323
 
320
324
static DRIZZLE_SYSVAR_BOOL(enable, enabled, PLUGIN_VAR_NOCMDARG,
321
325
                           N_("Enable the console."), NULL, NULL, false);
322
 
 
323
326
static DRIZZLE_SYSVAR_BOOL(debug, debug_enabled, PLUGIN_VAR_NOCMDARG,
324
327
                           N_("Turn on extra debugging."), NULL, NULL, false);
 
328
 
325
329
static DRIZZLE_SYSVAR_STR(user, user, PLUGIN_VAR_READONLY,
326
330
                          N_("User to use for auth."), NULL, NULL, NULL);
327
331
static DRIZZLE_SYSVAR_STR(password, password, PLUGIN_VAR_READONLY,
329
333
static DRIZZLE_SYSVAR_STR(db, db, PLUGIN_VAR_READONLY,
330
334
                          N_("Default database to use."), NULL, NULL, NULL);
331
335
 
 
336
static void init_options(drizzled::module::option_context &context)
 
337
{
 
338
  context("enable",
 
339
          po::value<bool>(&enabled)->default_value(false)->zero_tokens(),
 
340
          N_("Enable the console."));
 
341
  context("debug",
 
342
          po::value<bool>(&debug_enabled)->default_value(false)->zero_tokens(),
 
343
          N_("Turn on extra debugging."));
 
344
}
 
345
 
332
346
static drizzle_sys_var* vars[]= {
333
347
  DRIZZLE_SYSVAR(enable),
334
348
  DRIZZLE_SYSVAR(debug),
348
362
  PLUGIN_LICENSE_BSD,
349
363
  init,   /* Plugin Init */
350
364
  vars,   /* system variables */
351
 
  NULL    /* config options */
 
365
  init_options    /* config options */
352
366
}
353
367
DRIZZLE_DECLARE_PLUGIN_END;