default.c 15 KB
Newer Older
1
/* Copyright (C) 2000-2003 MySQL AB
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
2 3 4 5 6 7 8

   This program is free software; you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation; either version 2 of the License, or
   (at your option) any later version.

   This program is distributed in the hope that it will be useful,
bk@work.mysql.com's avatar
bk@work.mysql.com committed
9
   but WITHOUT ANY WARRANTY; without even the implied warranty of
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
10 11 12 13 14 15
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   GNU General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; if not, write to the Free Software
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
bk@work.mysql.com's avatar
bk@work.mysql.com committed
16 17

/****************************************************************************
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
 Add all options from files named "group".cnf from the default_directories
 before the command line arguments.
 On Windows defaults will also search in the Windows directory for a file
 called 'group'.ini
 As long as the program uses the last argument for conflicting
 options one only have to add a call to "load_defaults" to enable
 use of default values.
 pre- and end 'blank space' are removed from options and values. The
 following escape sequences are recognized in values:  \b \t \n \r \\

 The following arguments are handled automaticly;  If used, they must be
 first argument on the command line!
 --no-defaults	; no options are read.
 --defaults-file=full-path-to-default-file	; Only this file will be read.
 --defaults-extra-file=full-path-to-default-file ; Read this file before ~/
 --print-defaults	; Print the modified command line and exit
bk@work.mysql.com's avatar
bk@work.mysql.com committed
34 35 36 37 38
****************************************************************************/

#include "mysys_priv.h"
#include "m_string.h"
#include "m_ctype.h"
39
#include <my_dir.h>
bk@work.mysql.com's avatar
bk@work.mysql.com committed
40

monty@tramp.mysql.fi's avatar
monty@tramp.mysql.fi committed
41 42
char *defaults_extra_file=0;

bk@work.mysql.com's avatar
bk@work.mysql.com committed
43 44 45 46 47
/* Which directories are searched for options (and in which order) */

const char *default_directories[]= {
#ifdef __WIN__
"C:/",
monty@mashka.mysql.fi's avatar
monty@mashka.mysql.fi committed
48 49
#elif defined(__NETWARE__)
"sys:/etc/",
bk@work.mysql.com's avatar
bk@work.mysql.com committed
50 51 52 53 54 55
#else
"/etc/",
#endif
#ifdef DATADIR
DATADIR,
#endif
monty@tramp.mysql.fi's avatar
monty@tramp.mysql.fi committed
56
"",					/* Place for defaults_extra_dir */
monty@mashka.mysql.fi's avatar
monty@mashka.mysql.fi committed
57
#if !defined(__WIN__) && !defined(__NETWARE__)
bk@work.mysql.com's avatar
bk@work.mysql.com committed
58 59 60 61 62 63
"~/",
#endif
NullS,
};

#ifdef __WIN__
64
static const char *f_extensions[]= { ".ini", ".cnf", 0 };
65 66
#else
static const char *f_extensions[]= { ".cnf", 0 };
bk@work.mysql.com's avatar
bk@work.mysql.com committed
67 68
#endif

69 70
static int search_default_file(DYNAMIC_ARRAY *args,MEM_ROOT *alloc,
			       const char *dir, const char *config_file,
71 72 73 74 75 76
			       TYPELIB *group);

static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
					const char *dir, const char *ext,
					const char *config_file,
					TYPELIB *group);
bk@work.mysql.com's avatar
bk@work.mysql.com committed
77

78
static char *remove_end_comment(char *ptr);
bk@work.mysql.com's avatar
bk@work.mysql.com committed
79

80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112

/*
  Read options from configurations files

  SYNOPSIS
    load_defaults()
    conf_file			Basename for configuration file to search for.
    				If this is a path, then only this file is read.
    groups			Which [group] entrys to read.
				Points to an null terminated array of pointers
    argc			Pointer to argc of original program
    argv			Pointer to argv of original program

  IMPLEMENTATION

   Read options from configuration files and put them BEFORE the arguments
   that are already in argc and argv.  This way the calling program can
   easily command line options override options in configuration files

   NOTES
    In case of fatal error, the function will print a warning and do
    exit(1)
 
    To free used memory one should call free_defaults() with the argument
    that was put in *argv

   RETURN
     0	ok
     1	The given conf_file didn't exists
     2	The given conf_file was not a normal readable file
*/


113
int load_defaults(const char *conf_file, const char **groups,
bk@work.mysql.com's avatar
bk@work.mysql.com committed
114 115 116
		   int *argc, char ***argv)
{
  DYNAMIC_ARRAY args;
monty@tramp.mysql.fi's avatar
monty@tramp.mysql.fi committed
117
  const char **dirs, *forced_default_file;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
118 119
  TYPELIB group;
  my_bool found_print_defaults=0;
monty@tramp.mysql.fi's avatar
monty@tramp.mysql.fi committed
120
  uint args_used=0;
121
  int error= 0;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
122
  MEM_ROOT alloc;
123
  char *ptr, **res;
124

bk@work.mysql.com's avatar
bk@work.mysql.com committed
125 126
  DBUG_ENTER("load_defaults");

127
  init_alloc_root(&alloc,512,0);
bk@work.mysql.com's avatar
bk@work.mysql.com committed
128 129 130 131 132 133 134 135 136 137 138
  if (*argc >= 2 && !strcmp(argv[0][1],"--no-defaults"))
  {
    /* remove the --no-defaults argument and return only the other arguments */
    uint i;
    if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+
				 (*argc + 1)*sizeof(char*))))
      goto err;
    res= (char**) (ptr+sizeof(alloc));
    res[0]= **argv;				/* Copy program name */
    for (i=2 ; i < (uint) *argc ; i++)
      res[i-1]=argv[0][i];
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
139
    res[i-1]=0;					/* End pointer */
bk@work.mysql.com's avatar
bk@work.mysql.com committed
140 141 142
    (*argc)--;
    *argv=res;
    *(MEM_ROOT*) ptr= alloc;			/* Save alloc root for free */
143
    DBUG_RETURN(0);
bk@work.mysql.com's avatar
bk@work.mysql.com committed
144 145 146
  }

  /* Check if we want to force the use a specific default file */
monty@tramp.mysql.fi's avatar
monty@tramp.mysql.fi committed
147 148 149 150 151 152 153 154 155 156 157 158 159 160
  forced_default_file=0;
  if (*argc >= 2)
  {
    if (is_prefix(argv[0][1],"--defaults-file="))
    {
      forced_default_file=strchr(argv[0][1],'=')+1;
      args_used++;
    }
    else if (is_prefix(argv[0][1],"--defaults-extra-file="))
    {
      defaults_extra_file=strchr(argv[0][1],'=')+1;
      args_used++;
    }
  }
bk@work.mysql.com's avatar
bk@work.mysql.com committed
161 162 163 164 165 166 167

  group.count=0;
  group.name= "defaults";
  group.type_names= groups;
  for (; *groups ; groups++)
    group.count++;

168
  if (my_init_dynamic_array(&args, sizeof(char*),*argc, 32))
bk@work.mysql.com's avatar
bk@work.mysql.com committed
169
    goto err;
monty@tramp.mysql.fi's avatar
monty@tramp.mysql.fi committed
170
  if (forced_default_file)
bk@work.mysql.com's avatar
bk@work.mysql.com committed
171
  {
172 173 174
    if ((error= search_default_file_with_ext(&args, &alloc, "", "",
					     forced_default_file, 
					     &group)) < 0)
bk@work.mysql.com's avatar
bk@work.mysql.com committed
175
      goto err;
176 177 178 179 180 181
    if (error > 0)
    {
      fprintf(stderr, "Could not open required defaults file: %s\n",
              forced_default_file);
      goto err;
    }
bk@work.mysql.com's avatar
bk@work.mysql.com committed
182 183 184
  }
  else if (dirname_length(conf_file))
  {
185 186 187
    if ((error= search_default_file(&args, &alloc, NullS, conf_file,
				    &group)) < 0)
      goto err;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
188 189 190 191 192 193
  }
  else
  {
#ifdef __WIN__
    char system_dir[FN_REFLEN];
    GetWindowsDirectory(system_dir,sizeof(system_dir));
194
    if ((search_default_file(&args, &alloc, system_dir, conf_file, &group)))
bk@work.mysql.com's avatar
bk@work.mysql.com committed
195
      goto err;
196
#endif
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
197
#if defined(__EMX__) || defined(OS2)
198 199 200 201 202
    {
      const char *etc;
      if ((etc= getenv("ETC")) &&
	  (search_default_file(&args, &alloc, etc, conf_file, 
			       &group)) < 0)
203
      goto err;
204
    }
bk@work.mysql.com's avatar
bk@work.mysql.com committed
205 206 207
#endif
    for (dirs=default_directories ; *dirs; dirs++)
    {
monty@tramp.mysql.fi's avatar
monty@tramp.mysql.fi committed
208
      if (**dirs)
209 210
      {
	if (search_default_file(&args, &alloc, *dirs, conf_file,
211
				&group) < 0)
212 213
	  goto err;
      }
monty@tramp.mysql.fi's avatar
monty@tramp.mysql.fi committed
214
      else if (defaults_extra_file)
215 216
      {
	if (search_default_file(&args, &alloc, NullS, defaults_extra_file,
217
				&group) < 0)
218 219
	  goto err;				/* Fatal error */
      }
bk@work.mysql.com's avatar
bk@work.mysql.com committed
220 221
    }
  }
222 223 224 225
  /*
    Here error contains <> 0 only if we have a fully specified conf_file
    or a forced default file
  */
bk@work.mysql.com's avatar
bk@work.mysql.com committed
226 227 228 229 230 231
  if (!(ptr=(char*) alloc_root(&alloc,sizeof(alloc)+
			       (args.elements + *argc +1) *sizeof(char*))))
    goto err;
  res= (char**) (ptr+sizeof(alloc));

  /* copy name + found arguments + command line arguments to new array */
232
  res[0]= argv[0][0];  /* Name MUST be set, even by embedded library */
bk@work.mysql.com's avatar
bk@work.mysql.com committed
233
  memcpy((gptr) (res+1), args.buffer, args.elements*sizeof(char*));
234
  /* Skip --defaults-file and --defaults-extra-file */
monty@tramp.mysql.fi's avatar
monty@tramp.mysql.fi committed
235 236
  (*argc)-= args_used;
  (*argv)+= args_used;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
237 238 239 240 241

  /* Check if we wan't to see the new argument list */
  if (*argc >= 2 && !strcmp(argv[0][1],"--print-defaults"))
  {
    found_print_defaults=1;
242
    --*argc; ++*argv;				/* skip argument */
bk@work.mysql.com's avatar
bk@work.mysql.com committed
243 244
  }

245 246 247
  if (*argc)
    memcpy((gptr) (res+1+args.elements), (char*) ((*argv)+1),
	   (*argc-1)*sizeof(char*));
bk@work.mysql.com's avatar
bk@work.mysql.com committed
248 249 250 251 252 253 254 255 256 257 258 259 260 261
  res[args.elements+ *argc]=0;			/* last null */

  (*argc)+=args.elements;
  *argv= (char**) res;
  *(MEM_ROOT*) ptr= alloc;			/* Save alloc root for free */
  delete_dynamic(&args);
  if (found_print_defaults)
  {
    int i;
    printf("%s would have been started with the following arguments:\n",
	   **argv);
    for (i=1 ; i < *argc ; i++)
      printf("%s ", (*argv)[i]);
    puts("");
262
    exit(0);
bk@work.mysql.com's avatar
bk@work.mysql.com committed
263
  }
264
  DBUG_RETURN(error);
bk@work.mysql.com's avatar
bk@work.mysql.com committed
265 266

 err:
267
  fprintf(stderr,"Fatal error in defaults handling. Program aborted\n");
bk@work.mysql.com's avatar
bk@work.mysql.com committed
268
  exit(1);
monty@mysql.com's avatar
monty@mysql.com committed
269
  return 0;					/* Keep compiler happy */
bk@work.mysql.com's avatar
bk@work.mysql.com committed
270 271 272 273 274 275 276
}


void free_defaults(char **argv)
{
  MEM_ROOT ptr;
  memcpy_fixed((char*) &ptr,(char *) argv - sizeof(ptr), sizeof(ptr));
277
  free_root(&ptr,MYF(0));
bk@work.mysql.com's avatar
bk@work.mysql.com committed
278 279 280
}


281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297
static int search_default_file(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
			       const char *dir,
			       const char *config_file, TYPELIB *group)
{
  char **ext;

  for (ext= (char**) f_extensions; *ext; *ext++)
  {
    int error;
    if ((error= search_default_file_with_ext(args, alloc, dir, *ext,
					     config_file, group)) < 0)
      return error;
  }
  return 0;
}


298
/*
299 300 301
  Open a configuration file (if exists) and read given options from it
  
  SYNOPSIS
302
    search_default_file_with_ext()
303 304 305 306 307 308 309 310 311 312 313 314
    args			Store pointer to found options here
    alloc			Allocate strings in this object
    dir				directory to read
    config_file			Name of configuration file
    ext				Extension for configuration file
    group			groups to read

  RETURN
    0   Success
    -1	Fatal error, abort
     1	File not found (Warning)
     2  File is not a regular file (Warning)
315 316
*/

317 318 319 320
static int search_default_file_with_ext(DYNAMIC_ARRAY *args, MEM_ROOT *alloc,
					const char *dir, const char *ext,
					const char *config_file,
					TYPELIB *group)
bk@work.mysql.com's avatar
bk@work.mysql.com committed
321
{
322
  char name[FN_REFLEN+10],buff[4096],*ptr,*end,*value,*tmp;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
323 324 325 326 327 328 329 330
  FILE *fp;
  uint line=0;
  my_bool read_values=0,found_group=0;

  if ((dir ? strlen(dir) : 0 )+strlen(config_file) >= FN_REFLEN-3)
    return 0;					/* Ignore wrong paths */
  if (dir)
  {
331
    end=convert_dirname(name, dir, NullS);
bk@work.mysql.com's avatar
bk@work.mysql.com committed
332
    if (dir[0] == FN_HOMELIB)		/* Add . to filenames in home */
333 334
      *end++='.';
    strxmov(end,config_file,ext,NullS);
bk@work.mysql.com's avatar
bk@work.mysql.com committed
335 336 337 338 339
  }
  else
  {
    strmov(name,config_file);
  }
340
  fn_format(name,name,"","",4);
341
#if !defined(__WIN__) && !defined(OS2) && !defined(__NETWARE__)
342 343
  {
    MY_STAT stat_info;
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
344
    if (!my_stat(name,&stat_info,MYF(0)))
345
      return 1;
346 347 348 349 350 351 352
    /*
      Ignore world-writable regular files.
      This is mainly done to protect us to not read a file created by
      the mysqld server, but the check is still valid in most context. 
    */
    if ((stat_info.st_mode & S_IWOTH) &&
	(stat_info.st_mode & S_IFMT) == S_IFREG)
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
353 354 355
    {
      fprintf(stderr, "warning: World-writeable config file %s is ignored\n",
              name);
356
      return 0;
serg@serg.mysql.com's avatar
serg@serg.mysql.com committed
357
    }
358 359
  }
#endif
bk@work.mysql.com's avatar
bk@work.mysql.com committed
360 361 362 363 364 365 366
  if (!(fp = my_fopen(fn_format(name,name,"","",4),O_RDONLY,MYF(0))))
    return 0;					/* Ignore wrong files */

  while (fgets(buff,sizeof(buff)-1,fp))
  {
    line++;
    /* Ignore comment and empty lines */
367
    for (ptr=buff ; my_isspace(&my_charset_latin1,*ptr) ; ptr++ ) ;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
368 369 370 371 372 373 374 375 376 377 378 379
    if (*ptr == '#' || *ptr == ';' || !*ptr)
      continue;
    if (*ptr == '[')				/* Group name */
    {
      found_group=1;
      if (!(end=(char *) strchr(++ptr,']')))
      {
	fprintf(stderr,
		"error: Wrong group definition in config file: %s at line %d\n",
		name,line);
	goto err;
      }
380
      for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ;/* Remove end space */
bk@work.mysql.com's avatar
bk@work.mysql.com committed
381 382 383 384 385 386 387 388 389 390 391 392 393
      end[0]=0;
      read_values=find_type(ptr,group,3) > 0;
      continue;
    }
    if (!found_group)
    {
      fprintf(stderr,
	      "error: Found option without preceding group in config file: %s at line: %d\n",
	      name,line);
      goto err;
    }
    if (!read_values)
      continue;
394 395 396
    end= remove_end_comment(ptr);
    if ((value= strchr(ptr, '=')))
      end= value;				/* Option without argument */
397
    for ( ; my_isspace(&my_charset_latin1,end[-1]) ; end--) ;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
398 399 400 401 402 403 404 405 406 407 408 409
    if (!value)
    {
      if (!(tmp=alloc_root(alloc,(uint) (end-ptr)+3)))
	goto err;
      strmake(strmov(tmp,"--"),ptr,(uint) (end-ptr));
      if (insert_dynamic(args,(gptr) &tmp))
	goto err;
    }
    else
    {
      /* Remove pre- and end space */
      char *value_end;
410
      for (value++ ; my_isspace(&my_charset_latin1,*value); value++) ;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
411
      value_end=strend(value);
412 413 414 415
      /*
	We don't have to test for value_end >= value as we know there is
	an '=' before
      */
416
      for ( ; my_isspace(&my_charset_latin1,value_end[-1]) ; value_end--) ;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
417 418
      if (value_end < value)			/* Empty string */
	value_end=value;
419 420 421 422 423 424 425

      /* remove quotes around argument */
      if ((*value == '\"' || *value == '\'') && *value == value_end[-1])
      {
	value++;
	value_end--;
      }
bk@work.mysql.com's avatar
bk@work.mysql.com committed
426 427 428 429 430 431 432
      if (!(tmp=alloc_root(alloc,(uint) (end-ptr)+3 +
			   (uint) (value_end-value)+1)))
	goto err;
      if (insert_dynamic(args,(gptr) &tmp))
	goto err;
      ptr=strnmov(strmov(tmp,"--"),ptr,(uint) (end-ptr));
      *ptr++= '=';
433

bk@work.mysql.com's avatar
bk@work.mysql.com committed
434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453
      for ( ; value != value_end; value++)
      {
	if (*value == '\\' && value != value_end-1)
	{
	  switch(*++value) {
	  case 'n':
	    *ptr++='\n';
	    break;
	  case 't':
	    *ptr++= '\t';
	    break;
	  case 'r':
	    *ptr++ = '\r';
	    break;
	  case 'b':
	    *ptr++ = '\b';
	    break;
	  case 's':
	    *ptr++= ' ';			/* space */
	    break;
454 455 456 457 458 459
	  case '\"':
	    *ptr++= '\"';
	    break;
	  case '\'':
	    *ptr++= '\'';
	    break;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479
	  case '\\':
	    *ptr++= '\\';
	    break;
	  default:				/* Unknown; Keep '\' */
	    *ptr++= '\\';
	    *ptr++= *value;
	    break;
	  }
	}
	else
	  *ptr++= *value;
      }
      *ptr=0;
    }
  }
  my_fclose(fp,MYF(0));
  return(0);

 err:
  my_fclose(fp,MYF(0));
480
  return -1;					/* Fatal error */
bk@work.mysql.com's avatar
bk@work.mysql.com committed
481 482 483
}


484 485
static char *remove_end_comment(char *ptr)
{
486 487
  char quote= 0;	/* we are inside quote marks */
  char escape= 0;	/* symbol is protected by escape chagacter */
488 489 490

  for (; *ptr; ptr++)
  {
491
    if ((*ptr == '\'' || *ptr == '\"') && !escape)
492 493 494 495 496 497
    {
      if (!quote)
	quote= *ptr;
      else if (quote == *ptr)
	quote= 0;
    }
monty@mysql.com's avatar
monty@mysql.com committed
498
    /* We are not inside a string */
499
    if (!quote && *ptr == '#')
500 501 502 503
    {
      *ptr= 0;
      return ptr;
    }
504
    escape= (quote && *ptr == '\\' && !escape);
505 506 507 508
  }
  return ptr;
}

monty@mysql.com's avatar
monty@mysql.com committed
509
#include <help_start.h>
510

bk@work.mysql.com's avatar
bk@work.mysql.com committed
511 512 513
void print_defaults(const char *conf_file, const char **groups)
{
#ifdef __WIN__
514
  my_bool have_ext= fn_ext(conf_file)[0] != 0;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
515
#endif
516
  char name[FN_REFLEN], **ext;
bk@work.mysql.com's avatar
bk@work.mysql.com committed
517
  const char **dirs;
518

bk@work.mysql.com's avatar
bk@work.mysql.com committed
519 520 521 522 523 524 525 526
  puts("\nDefault options are read from the following files in the given order:");

  if (dirname_length(conf_file))
    fputs(conf_file,stdout);
  else
  {
#ifdef __WIN__
    GetWindowsDirectory(name,sizeof(name));
527 528
    if (!have_ext)
    {
529 530
      for (ext= (char**) f_extensions; *ext; *ext++)
        printf("%s\\%s%s ", name, conf_file, *ext);
531
    }
532 533
    else
        printf("%s\\%s ", name, conf_file);
534
#endif
monty@hundin.mysql.fi's avatar
monty@hundin.mysql.fi committed
535
#if defined(__EMX__) || defined(OS2)
536 537 538 539 540 541 542 543 544
    {
      const char *etc;

      if ((etc= getenv("ETC")))
      {
	for (ext= (char**) f_extensions; *ext; *ext++)
	  printf("%s\\%s%s ", etc, conf_file, *ext);
      }
    }
bk@work.mysql.com's avatar
bk@work.mysql.com committed
545 546 547
#endif
    for (dirs=default_directories ; *dirs; dirs++)
    {
548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563
      for (ext= (char**) f_extensions; *ext; *ext++)
      {
	const char *pos;
	char *end;
	if (**dirs)
	  pos= *dirs;
	else if (defaults_extra_file)
	  pos= defaults_extra_file;
	else
	  continue;
	end= convert_dirname(name, pos, NullS);
	if (name[0] == FN_HOMELIB)	/* Add . to filenames in home */
	  *end++='.';
	strxmov(end, conf_file, *ext, " ", NullS);
	fputs(name,stdout);
      }
bk@work.mysql.com's avatar
bk@work.mysql.com committed
564 565 566 567 568 569 570 571 572 573 574 575
    }
    puts("");
  }
  fputs("The following groups are read:",stdout);
  for ( ; *groups ; groups++)
  {
    fputc(' ',stdout);
    fputs(*groups,stdout);
  }
  puts("\nThe following options may be given as the first argument:\n\
--print-defaults	Print the program argument list and exit\n\
--no-defaults		Don't read default options from any options file\n\
576 577
--defaults-file=#	Only read default options from the given file #\n\
--defaults-extra-file=# Read this file after the global files are read");
bk@work.mysql.com's avatar
bk@work.mysql.com committed
578
}
monty@mysql.com's avatar
monty@mysql.com committed
579 580

#include <help_end.h>