options.cc File Reference

#include "options.h"
#include <my_global.h>
#include <my_sys.h>
#include <my_getopt.h>

Include dependency graph for options.cc:

Include dependency graph

Defines

#define QUOTE2(x)   #x
#define QUOTE(x)   QUOTE2(x)

Enumerations

enum  options { OPT_LOG = 256, OPT_PID_FILE, OPT_SOCKET, OPT_RUN_AS_SERVICE }

Functions

void version ()
void usage ()
C_MODE_START my_bool get_one_option (int optid, const struct my_option *opt __attribute__((unused)), char *argument __attribute__((unused)))

Variables

my_option my_long_options []

Define Documentation

#define QUOTE x   )     QUOTE2(x)
 

#define QUOTE2 x   )     #x
 


Enumeration Type Documentation

enum options
 

Enumeration values:
OPT_LOG 
OPT_PID_FILE 
OPT_SOCKET 
OPT_RUN_AS_SERVICE 
00041              {
00042   OPT_LOG= 256,
00043   OPT_PID_FILE,
00044   OPT_SOCKET,
00045   OPT_RUN_AS_SERVICE 
00046 };


Function Documentation

C_MODE_START my_bool get_one_option int  optid,
const struct my_option *opt   __attribute__((unused)),
char *argument   __attribute__((unused))
[static]
 

00094 {
00095   switch(optid) {
00096   case 'V':
00097     version();
00098     exit(0);
00099   case 'I':
00100   case '?':
00101     usage();
00102     exit(0);
00103   }
00104   return 0;
00105 }

void usage void   )  [static]
 

00083 {
00084   version();
00085   my_print_help(my_long_options);
00086 }

void version  )  [static]
 

00076 {
00077   static const char mysqlmanager_version[] = "0.1-alpha";
00078   printf("%s  Ver %s for %s on %s\n", my_progname, mysqlmanager_version,
00079          SYSTEM_TYPE, MACHINE_TYPE);
00080 }


Variable Documentation

struct my_option my_long_options[] [static]
 

Initial value:

{
  { "help", '?', "Display this help and exit.",
   0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },

  { "log", OPT_LOG, "Path to log file. Used only with --run-as-service.",
    (gptr *) &Options::log_file_name, (gptr *) &Options::log_file_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },

  { "pid-file", OPT_PID_FILE, "Pid file to use.",
    (gptr *) &Options::pid_file_name, (gptr *) &Options::pid_file_name,
   0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },
  
  { "socket", OPT_SOCKET, "Socket file to use for connection.",
    (gptr *) &Options::socket_file_name, (gptr *) &Options::socket_file_name,
    0, GET_STR, REQUIRED_ARG, 0, 0, 0, 0, 0, 0 },

  { "run-as-service", OPT_RUN_AS_SERVICE,
    "Daemonize and start angel process.", (gptr *) &Options::run_as_service,
    0, 0, GET_BOOL, NO_ARG, 0, 0, 1, 0, 0, 0 },

  { "version", 'V', "Output version information and exit.", 0, 0, 0,
   GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 },

  { 0, 0, 0, 0, 0, 0, GET_NO_ARG, NO_ARG, 0, 0, 0, 0, 0, 0 }
}


Generated on Thu Feb 24 11:01:19 2005 for MySQL by  doxygen 1.3.9.1