474
#if defined(ENABLE_NLS)
475
# if defined(HAVE_LOCALE_H)
476
setlocale(LC_ALL, "");
478
bindtextdomain("drizzle7", LOCALEDIR);
479
textdomain("drizzle7");
482
po::options_description commandline_options(_("Options used only in command line"));
476
po::options_description commandline_options(N_("Options used only in command line"));
483
477
commandline_options.add_options()
484
478
("all-databases,A", po::value<bool>(&opt_alldbs)->default_value(false)->zero_tokens(),
485
_("Dump all the databases. This will be same as --databases with all databases selected."))
479
N_("Dump all the databases. This will be same as --databases with all databases selected."))
486
480
("all-tablespaces,Y", po::value<bool>(&opt_alltspcs)->default_value(false)->zero_tokens(),
487
_("Dump all the tablespaces."))
481
N_("Dump all the tablespaces."))
488
482
("complete-insert,c", po::value<bool>(&opt_complete_insert)->default_value(false)->zero_tokens(),
489
_("Use complete insert statements."))
483
N_("Use complete insert statements."))
490
484
("flush-logs,F", po::value<bool>(&flush_logs)->default_value(false)->zero_tokens(),
491
_("Flush logs file in server before starting dump. Note that if you dump many databases at once (using the option --databases= or --all-databases), the logs will be flushed for each database dumped. The exception is when using --lock-all-tables in this case the logs will be flushed only once, corresponding to the moment all tables are locked. So if you want your dump and the log flush to happen at the same exact moment you should use --lock-all-tables or --flush-logs"))
485
N_("Flush logs file in server before starting dump. Note that if you dump many databases at once (using the option --databases= or --all-databases), the logs will be flushed for each database dumped. The exception is when using --lock-all-tables in this case the logs will be flushed only once, corresponding to the moment all tables are locked. So if you want your dump and the log flush to happen at the same exact moment you should use --lock-all-tables or --flush-logs"))
492
486
("force,f", po::value<bool>(&ignore_errors)->default_value(false)->zero_tokens(),
493
_("Continue even if we get an sql-error."))
494
("help,?", _("Display this help message and exit."))
487
N_("Continue even if we get an sql-error."))
488
("help,?", N_("Display this help message and exit."))
495
489
("lock-all-tables,x", po::value<bool>(&opt_lock_all_tables)->default_value(false)->zero_tokens(),
496
_("Locks all tables across all databases. This is achieved by taking a global read lock for the duration of the whole dump. Automatically turns --single-transaction off."))
490
N_("Locks all tables across all databases. This is achieved by taking a global read lock for the duration of the whole dump. Automatically turns --single-transaction off."))
497
491
("single-transaction", po::value<bool>(&opt_single_transaction)->default_value(false)->zero_tokens(),
498
_("Creates a consistent snapshot by dumping all tables in a single transaction. Works ONLY for tables stored in storage engines which support multiversioning (currently only InnoDB does); the dump is NOT guaranteed to be consistent for other storage engines. While a --single-transaction dump is in process, to ensure a valid dump file (correct table contents), no other connection should use the following statements: ALTER TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not isolated from them."))
492
N_("Creates a consistent snapshot by dumping all tables in a single transaction. Works ONLY for tables stored in storage engines which support multiversioning (currently only InnoDB does); the dump is NOT guaranteed to be consistent for other storage engines. While a --single-transaction dump is in process, to ensure a valid dump file (correct table contents), no other connection should use the following statements: ALTER TABLE, DROP TABLE, RENAME TABLE, TRUNCATE TABLE, as consistent snapshot is not isolated from them."))
500
_("Disable --opt. Disables --add-drop-table, --add-locks, --create-options, ---extended-insert and --disable-keys."))
501
("tables", _("Overrides option --databases (-B)."))
494
N_("Disable --opt. Disables --add-drop-table, --add-locks, --create-options, ---extended-insert and --disable-keys."))
495
("tables", N_("Overrides option --databases (-B)."))
502
496
("show-progress-size", po::value<uint32_t>(&show_progress_size)->default_value(10000),
503
_("Number of rows before each output progress report (requires --verbose)."))
497
N_("Number of rows before each output progress report (requires --verbose)."))
504
498
("verbose,v", po::value<bool>(&verbose)->default_value(false)->zero_tokens(),
505
_("Print info about the various stages."))
506
("version,V", _("Output version information and exit."))
507
("skip-comments", _("Turn off Comments"))
508
("skip-create", _("Turn off create-options"))
509
("skip-extended-insert", _("Turn off extended-insert"))
510
("skip-dump-date", _( "Turn off dump date at the end of the output"))
511
("no-defaults", _("Do not read from the configuration files"))
499
N_("Print info about the various stages."))
500
("version,V", N_("Output version information and exit."))
501
("skip-comments", N_("Turn off Comments"))
502
("skip-create", N_("Turn off create-options"))
503
("skip-extended-insert", N_("Turn off extended-insert"))
504
("skip-dump-date",N_( "Turn off dump date at the end of the output"))
505
("no-defaults", N_("Do not read from the configuration files"))
514
po::options_description dump_options(_("Options specific to the drizzle client"));
508
po::options_description dump_options(N_("Options specific to the drizzle client"));
515
509
dump_options.add_options()
516
510
("add-drop-database", po::value<bool>(&opt_drop_database)->default_value(false)->zero_tokens(),
517
_("Add a 'DROP DATABASE' before each create."))
518
("skip-drop-table", _("Do not add a 'drop table' before each create."))
511
N_("Add a 'DROP DATABASE' before each create."))
512
("skip-drop-table", N_("Do not add a 'drop table' before each create."))
519
513
("compact", po::value<bool>(&opt_compact)->default_value(false)->zero_tokens(),
520
_("Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys"))
514
N_("Give less verbose output (useful for debugging). Disables structure comments and header/footer constructs. Enables options --skip-add-drop-table --no-set-names --skip-disable-keys"))
521
515
("databases,B", po::value<bool>(&opt_databases)->default_value(false)->zero_tokens(),
522
_("To dump several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames. 'USE db_name;' will be included in the output."))
516
N_("To dump several databases. Note the difference in usage; In this case no tables are given. All name arguments are regarded as databasenames. 'USE db_name;' will be included in the output."))
523
517
("skip-disable-keys,K",
524
_("'ALTER TABLE tb_name DISABLE KEYS;' and 'ALTER TABLE tb_name ENABLE KEYS;' will not be put in the output."))
518
N_("'ALTER TABLE tb_name DISABLE KEYS; and 'ALTER TABLE tb_name ENABLE KEYS; will not be put in the output."))
525
519
("ignore-table", po::value<string>(),
526
_("Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names, e.g. --ignore-table=database.table"))
520
N_("Do not dump the specified table. To specify more than one table to ignore, use the directive multiple times, once for each table. Each table must be specified with both database and table names, e.g. --ignore-table=database.table"))
527
521
("insert-ignore", po::value<bool>(&opt_ignore)->default_value(false)->zero_tokens(),
528
_("Insert rows with INSERT IGNORE."))
522
N_("Insert rows with INSERT IGNORE."))
529
523
("no-autocommit", po::value<bool>(&opt_autocommit)->default_value(false)->zero_tokens(),
530
_("Wrap a table's data in START TRANSACTION/COMMIT statements."))
524
N_("Wrap a table's data in START TRANSACTION/COMMIT statements."))
531
525
("no-create-db,n", po::value<bool>(&opt_create_db)->default_value(false)->zero_tokens(),
532
_("'CREATE DATABASE IF NOT EXISTS db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given."))
526
N_("'CREATE DATABASE IF NOT EXISTS db_name;' will not be put in the output. The above line will be added otherwise, if --databases or --all-databases option was given."))
533
527
("no-data,d", po::value<bool>(&opt_no_data)->default_value(false)->zero_tokens(),
534
_("No row information."))
528
N_("No row information."))
535
529
("replace", po::value<bool>(&opt_replace_into)->default_value(false)->zero_tokens(),
536
_("Use REPLACE INTO instead of INSERT INTO."))
530
N_("Use REPLACE INTO instead of INSERT INTO."))
537
531
("destination-type", po::value<string>()->default_value("stdout"),
538
_("Where to send output to (stdout|database"))
532
N_("Where to send output to (stdout|database"))
539
533
("destination-host", po::value<string>(&opt_destination_host)->default_value("localhost"),
540
_("Hostname for destination db server (requires --destination-type=database)"))
541
("destination-port", po::value<uint16_t>(&opt_destination_port)->default_value(4427),
542
_("Port number for destination db server (requires --destination-type=database)"))
534
N_("Hostname for destination db server (requires --destination-type=database)"))
535
("destination-port", po::value<uint16_t>(&opt_destination_port)->default_value(3306),
536
N_("Port number for destination db server (requires --destination-type=database)"))
543
537
("destination-user", po::value<string>(&opt_destination_user),
544
_("User name for destination db server (resquires --destination-type=database)"))
538
N_("User name for destination db server (resquires --destination-type=database)"))
545
539
("destination-password", po::value<string>(&opt_destination_password),
546
_("Password for destination db server (requires --destination-type=database)"))
540
N_("Password for destination db server (requires --destination-type=database)"))
547
541
("destination-database", po::value<string>(&opt_destination_database),
548
_("The database in the destination db server (requires --destination-type=database, not for use with --all-databases)"))
549
("my-data-is-mangled", po::value<bool>(&opt_data_is_mangled)->default_value(false)->zero_tokens(),
550
_("Do not make a UTF8 connection to MySQL, use if you have UTF8 data in a non-UTF8 table"))
542
N_("The database in the destination db server (requires --destination-type=database, not for use with --all-databases)"))
553
po::options_description client_options(_("Options specific to the client"));
545
po::options_description client_options(N_("Options specific to the client"));
554
546
client_options.add_options()
555
547
("host,h", po::value<string>(¤t_host)->default_value("localhost"),
556
_("Connect to host."))
548
N_("Connect to host."))
557
549
("password,P", po::value<string>(&password)->default_value(PASSWORD_SENTINEL),
558
_("Password to use when connecting to server. If password is not given it's solicited on the tty."))
550
N_("Password to use when connecting to server. If password is not given it's solicited on the tty."))
559
551
("port,p", po::value<uint32_t>(&opt_drizzle_port)->default_value(0),
560
_("Port number to use for connection."))
552
N_("Port number to use for connection."))
561
553
("user,u", po::value<string>(¤t_user)->default_value(""),
562
_("User for login if not current user."))
554
N_("User for login if not current user."))
563
555
("protocol",po::value<string>(&opt_protocol)->default_value("mysql"),
564
_("The protocol of connection (mysql or drizzle)."))
556
N_("The protocol of connection (mysql or drizzle)."))
567
po::options_description hidden_options(_("Hidden Options"));
559
po::options_description hidden_options(N_("Hidden Options"));
568
560
hidden_options.add_options()
569
("database-used", po::value<vector<string> >(), _("Used to select the database"))
570
("Table-used", po::value<vector<string> >(), _("Used to select the tables"))
561
("database-used", po::value<vector<string> >(), N_("Used to select the database"))
562
("Table-used", po::value<vector<string> >(), N_("Used to select the tables"))
573
po::options_description all_options(_("Allowed Options + Hidden Options"));
565
po::options_description all_options(N_("Allowed Options + Hidden Options"));
574
566
all_options.add(commandline_options).add(dump_options).add(client_options).add(hidden_options);
576
po::options_description long_options(_("Allowed Options"));
568
po::options_description long_options(N_("Allowed Options"));
577
569
long_options.add(commandline_options).add(dump_options).add(client_options);
579
571
std::string system_config_dir_dump(SYSCONFDIR);