~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to drizzled/internal/default.cc

  • Committer: Barry.Leslie at PrimeBase
  • Date: 2010-07-14 22:58:28 UTC
  • mto: This revision was merged to the branch mainline in revision 1662.
  • Revision ID: barry.leslie@primebase.com-20100714225828-lckjqjp4xre0n5ec
Fixed merger problem in plugin/pbms/plugin.am.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 
12
12
   You should have received a copy of the GNU General Public License
13
13
   along with this program; if not, write to the Free Software
14
 
   Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA */
 
14
   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA */
15
15
 
16
16
/****************************************************************************
17
17
 Add all options from files named "group".cnf from the default_directories
399
399
{
400
400
  DYNAMIC_ARRAY args;
401
401
  TYPELIB group;
 
402
  bool found_print_defaults= 0;
402
403
  uint32_t args_used= 0;
403
404
  int error= 0;
404
405
  memory::Root alloc(512);
463
464
    Check if we wan't to see the new argument list
464
465
    This options must always be the last of the default options
465
466
  */
 
467
  if (*argc >= 2 && !strcmp(argv[0][1],"--print-defaults"))
 
468
  {
 
469
    found_print_defaults=1;
 
470
    --*argc; ++*argv;                           /* skip argument */
 
471
  }
 
472
 
466
473
  if (*argc)
467
474
    memcpy(res+1+args.elements, *argv + 1, (*argc-1)*sizeof(char*));
468
475
  res[args.elements+ *argc]=0;                  /* last null */
471
478
  *argv= static_cast<char**>(res);
472
479
  *(memory::Root*) ptr= alloc;                  /* Save alloc root for free */
473
480
  delete_dynamic(&args);
474
 
 
 
481
  if (found_print_defaults)
 
482
  {
 
483
    int i;
 
484
    printf("%s would have been started with the following arguments:\n",
 
485
           **argv);
 
486
    for (i=1 ; i < *argc ; i++)
 
487
      printf("%s ", (*argv)[i]);
 
488
    puts("");
 
489
    exit(0);
 
490
  }
475
491
  return(error);
476
492
 
477
493
 err:
936
952
    }
937
953
  }
938
954
  puts("\nThe following options may be given as the first argument:\n\
 
955
  --print-defaults      Print the program argument list and exit\n\
939
956
  --no-defaults         Don't read default options from any options file\n\
940
957
  --defaults-file=#     Only read default options from the given file #\n\
941
958
  --defaults-extra-file=# Read this file after the global files are read");