added print_defaults() calls to --help output for all binaries (Bug #21994)

parent e3d56d2c
...@@ -82,6 +82,8 @@ int main(int argc, char** argv){ ...@@ -82,6 +82,8 @@ int main(int argc, char** argv){
load_defaults("ndb_cpcd",load_default_groups,&argc,&argv); load_defaults("ndb_cpcd",load_default_groups,&argc,&argv);
if (handle_options(&argc, &argv, my_long_options, get_one_option)) { if (handle_options(&argc, &argv, my_long_options, get_one_option)) {
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
exit(1); exit(1);
......
...@@ -63,6 +63,8 @@ static const char* _nowait_nodes; ...@@ -63,6 +63,8 @@ static const char* _nowait_nodes;
extern Uint32 g_start_type; extern Uint32 g_start_type;
extern NdbNodeBitmask g_nowait_nodes; extern NdbNodeBitmask g_nowait_nodes;
const char *load_default_groups[]= { "mysql_cluster","ndbd",0 };
/** /**
* Arguments to NDB process * Arguments to NDB process
*/ */
...@@ -108,6 +110,8 @@ static void usage() ...@@ -108,6 +110,8 @@ static void usage()
{ {
short_usage_sub(); short_usage_sub();
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
...@@ -115,7 +119,6 @@ static void usage() ...@@ -115,7 +119,6 @@ static void usage()
bool bool
Configuration::init(int argc, char** argv) Configuration::init(int argc, char** argv)
{ {
const char *load_default_groups[]= { "mysql_cluster","ndbd",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
int ho_error; int ho_error;
......
...@@ -38,6 +38,7 @@ extern "C" int add_history(const char *command); /* From readline directory */ ...@@ -38,6 +38,7 @@ extern "C" int add_history(const char *command); /* From readline directory */
#include "ndb_mgmclient.hpp" #include "ndb_mgmclient.hpp"
const char *progname = "ndb_mgm"; const char *progname = "ndb_mgm";
const char *load_default_groups[]= { "mysql_cluster","ndb_mgm",0 };
static Ndb_mgmclient* com; static Ndb_mgmclient* com;
...@@ -87,6 +88,8 @@ static void usage() ...@@ -87,6 +88,8 @@ static void usage()
{ {
short_usage_sub(); short_usage_sub();
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
...@@ -128,7 +131,6 @@ int main(int argc, char** argv){ ...@@ -128,7 +131,6 @@ int main(int argc, char** argv){
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char *_host = 0; const char *_host = 0;
int _port = 0; int _port = 0;
const char *load_default_groups[]= { "mysql_cluster","ndb_mgm",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
int ho_error; int ho_error;
......
...@@ -47,6 +47,7 @@ ...@@ -47,6 +47,7 @@
#define DEBUG(x) ndbout << x << endl; #define DEBUG(x) ndbout << x << endl;
const char progname[] = "mgmtsrvr"; const char progname[] = "mgmtsrvr";
const char *load_default_groups[]= { "mysql_cluster","ndb_mgmd",0 };
// copied from mysql.cc to get readline // copied from mysql.cc to get readline
extern "C" { extern "C" {
...@@ -183,6 +184,8 @@ static void usage() ...@@ -183,6 +184,8 @@ static void usage()
{ {
short_usage_sub(); short_usage_sub();
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
...@@ -196,7 +199,6 @@ int main(int argc, char** argv) ...@@ -196,7 +199,6 @@ int main(int argc, char** argv)
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster","ndb_mgmd",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
int ho_error; int ho_error;
......
...@@ -27,6 +27,8 @@ static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab, ...@@ -27,6 +27,8 @@ static int clear_table(Ndb* pNdb, const NdbDictionary::Table* pTab,
NDB_STD_OPTS_VARS; NDB_STD_OPTS_VARS;
const char *load_default_groups[]= { "mysql_cluster",0 };
static const char* _dbname = "TEST_DB"; static const char* _dbname = "TEST_DB";
static my_bool _transactional = false; static my_bool _transactional = false;
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
...@@ -46,13 +48,14 @@ static void usage() ...@@ -46,13 +48,14 @@ static void usage()
"tabname\n"\ "tabname\n"\
"This program will delete all records in the specified table using scan delete.\n"; "This program will delete all records in the specified table using scan delete.\n";
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
int main(int argc, char** argv){ int main(int argc, char** argv){
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
int ho_error; int ho_error;
#ifndef DBUG_OFF #ifndef DBUG_OFF
......
...@@ -24,6 +24,9 @@ NDB_STD_OPTS_VARS; ...@@ -24,6 +24,9 @@ NDB_STD_OPTS_VARS;
static const char* _dbname = "TEST_DB"; static const char* _dbname = "TEST_DB";
static int _unqualified = 0; static int _unqualified = 0;
static int _partinfo = 0; static int _partinfo = 0;
const char *load_default_groups[]= { "mysql_cluster",0 };
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
NDB_STD_OPTS("ndb_desc"), NDB_STD_OPTS("ndb_desc"),
...@@ -45,6 +48,8 @@ static void usage() ...@@ -45,6 +48,8 @@ static void usage()
"This program list all properties of table(s) in NDB Cluster.\n"\ "This program list all properties of table(s) in NDB Cluster.\n"\
" ex: desc T1 T2 T4\n"; " ex: desc T1 T2 T4\n";
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
...@@ -53,7 +58,6 @@ static void print_part_info(Ndb* pNdb, NDBT_Table* pTab); ...@@ -53,7 +58,6 @@ static void print_part_info(Ndb* pNdb, NDBT_Table* pTab);
int main(int argc, char** argv){ int main(int argc, char** argv){
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
int ho_error; int ho_error;
#ifndef DBUG_OFF #ifndef DBUG_OFF
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
NDB_STD_OPTS_VARS; NDB_STD_OPTS_VARS;
static const char* _dbname = "TEST_DB"; static const char* _dbname = "TEST_DB";
const char *load_default_groups[]= { "mysql_cluster",0 };
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
NDB_STD_OPTS("ndb_desc"), NDB_STD_OPTS("ndb_desc"),
...@@ -38,13 +41,14 @@ static void usage() ...@@ -38,13 +41,14 @@ static void usage()
"[<table> <index>]+\n"\ "[<table> <index>]+\n"\
"This program will drop index(es) in Ndb\n"; "This program will drop index(es) in Ndb\n";
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
int main(int argc, char** argv){ int main(int argc, char** argv){
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
int ho_error; int ho_error;
#ifndef DBUG_OFF #ifndef DBUG_OFF
......
...@@ -24,6 +24,9 @@ ...@@ -24,6 +24,9 @@
NDB_STD_OPTS_VARS; NDB_STD_OPTS_VARS;
static const char* _dbname = "TEST_DB"; static const char* _dbname = "TEST_DB";
const char *load_default_groups[]= { "mysql_cluster",0 };
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
NDB_STD_OPTS("ndb_desc"), NDB_STD_OPTS("ndb_desc"),
...@@ -38,13 +41,14 @@ static void usage() ...@@ -38,13 +41,14 @@ static void usage()
"tabname\n"\ "tabname\n"\
"This program will drop one table in Ndb\n"; "This program will drop one table in Ndb\n";
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
int main(int argc, char** argv){ int main(int argc, char** argv){
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
int ho_error; int ho_error;
#ifndef DBUG_OFF #ifndef DBUG_OFF
......
...@@ -32,6 +32,8 @@ static Ndb* ndb = 0; ...@@ -32,6 +32,8 @@ static Ndb* ndb = 0;
static const NdbDictionary::Dictionary * dic = 0; static const NdbDictionary::Dictionary * dic = 0;
static int _unqualified = 0; static int _unqualified = 0;
const char *load_default_groups[]= { "mysql_cluster",0 };
static void static void
fatal(char const* fmt, ...) fatal(char const* fmt, ...)
{ {
...@@ -196,6 +198,8 @@ static void usage() ...@@ -196,6 +198,8 @@ static void usage()
"To show all indexes for a table write table name as final argument\n"\ "To show all indexes for a table write table name as final argument\n"\
" ex: ndb_show_tables T1\n"; " ex: ndb_show_tables T1\n";
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
...@@ -203,7 +207,6 @@ static void usage() ...@@ -203,7 +207,6 @@ static void usage()
int main(int argc, char** argv){ int main(int argc, char** argv){
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char* _tabname; const char* _tabname;
const char *load_default_groups[]= { "mysql_cluster",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
int ho_error; int ho_error;
#ifndef DBUG_OFF #ifndef DBUG_OFF
......
...@@ -45,6 +45,8 @@ static const char * g_row_delimiter=" "; ...@@ -45,6 +45,8 @@ static const char * g_row_delimiter=" ";
static const char * g_config_file = 0; static const char * g_config_file = 0;
static int g_mycnf = 0; static int g_mycnf = 0;
const char *load_default_groups[]= { "mysql_cluster",0 };
int g_print_full_config, opt_ndb_shm; int g_print_full_config, opt_ndb_shm;
my_bool opt_core; my_bool opt_core;
...@@ -114,6 +116,8 @@ static void usage() ...@@ -114,6 +116,8 @@ static void usage()
char desc[] = char desc[] =
"This program will retreive config options for a ndb cluster\n"; "This program will retreive config options for a ndb cluster\n";
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
...@@ -176,7 +180,6 @@ static ndb_mgm_configuration* load_configuration(); ...@@ -176,7 +180,6 @@ static ndb_mgm_configuration* load_configuration();
int int
main(int argc, char** argv){ main(int argc, char** argv){
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
int ho_error; int ho_error;
if ((ho_error=handle_options(&argc, &argv, my_long_options, if ((ho_error=handle_options(&argc, &argv, my_long_options,
......
...@@ -52,6 +52,8 @@ static int _restore_data = 0; ...@@ -52,6 +52,8 @@ static int _restore_data = 0;
static int _restore_meta = 0; static int _restore_meta = 0;
BaseString g_options("ndb_restore"); BaseString g_options("ndb_restore");
const char *load_default_groups[]= { "mysql_cluster","ndb_restore",0 };
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
NDB_STD_OPTS("ndb_restore"), NDB_STD_OPTS("ndb_restore"),
...@@ -104,6 +106,8 @@ static void usage() ...@@ -104,6 +106,8 @@ static void usage()
{ {
short_usage_sub(); short_usage_sub();
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
...@@ -136,7 +140,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)), ...@@ -136,7 +140,6 @@ get_one_option(int optid, const struct my_option *opt __attribute__((unused)),
bool bool
readArguments(int *pargc, char*** pargv) readArguments(int *pargc, char*** pargv)
{ {
const char *load_default_groups[]= { "mysql_cluster","ndb_restore",0 };
load_defaults("my",load_default_groups,pargc,pargv); load_defaults("my",load_default_groups,pargc,pargv);
if (handle_options(pargc, pargv, my_long_options, get_one_option)) if (handle_options(pargc, pargv, my_long_options, get_one_option))
{ {
......
...@@ -43,6 +43,8 @@ static const char* _delimiter = "\t"; ...@@ -43,6 +43,8 @@ static const char* _delimiter = "\t";
static int _unqualified, _header, _parallelism, _useHexFormat, _lock, static int _unqualified, _header, _parallelism, _useHexFormat, _lock,
_order, _descending; _order, _descending;
const char *load_default_groups[]= { "mysql_cluster",0 };
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
NDB_STD_OPTS("ndb_desc"), NDB_STD_OPTS("ndb_desc"),
...@@ -82,13 +84,14 @@ static void usage() ...@@ -82,13 +84,14 @@ static void usage()
"It can also be used to dump the content of a table to file \n"\ "It can also be used to dump the content of a table to file \n"\
" ex: select_all --no-header --delimiter=';' T4 > T4.data\n"; " ex: select_all --no-header --delimiter=';' T4 > T4.data\n";
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
int main(int argc, char** argv){ int main(int argc, char** argv){
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
const char* _tabname; const char* _tabname;
int ho_error; int ho_error;
......
...@@ -37,6 +37,9 @@ NDB_STD_OPTS_VARS; ...@@ -37,6 +37,9 @@ NDB_STD_OPTS_VARS;
static const char* _dbname = "TEST_DB"; static const char* _dbname = "TEST_DB";
static int _parallelism = 240; static int _parallelism = 240;
static int _lock = 0; static int _lock = 0;
const char *load_default_groups[]= { "mysql_cluster",0 };
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
NDB_STD_OPTS("ndb_desc"), NDB_STD_OPTS("ndb_desc"),
...@@ -57,13 +60,14 @@ static void usage() ...@@ -57,13 +60,14 @@ static void usage()
"tabname1 ... tabnameN\n"\ "tabname1 ... tabnameN\n"\
"This program will count the number of records in tables\n"; "This program will count the number of records in tables\n";
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
int main(int argc, char** argv){ int main(int argc, char** argv){
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
int ho_error; int ho_error;
#ifndef DBUG_OFF #ifndef DBUG_OFF
......
...@@ -38,6 +38,9 @@ NDB_STD_OPTS_VARS; ...@@ -38,6 +38,9 @@ NDB_STD_OPTS_VARS;
static int _no_contact = 0; static int _no_contact = 0;
static int _not_started = 0; static int _not_started = 0;
static int _timeout = 120; static int _timeout = 120;
const char *load_default_groups[]= { "mysql_cluster",0 };
static struct my_option my_long_options[] = static struct my_option my_long_options[] =
{ {
NDB_STD_OPTS("ndb_desc"), NDB_STD_OPTS("ndb_desc"),
...@@ -56,13 +59,14 @@ static struct my_option my_long_options[] = ...@@ -56,13 +59,14 @@ static struct my_option my_long_options[] =
static void usage() static void usage()
{ {
ndb_std_print_version(); ndb_std_print_version();
print_defaults(MYSQL_CONFIG_NAME,load_default_groups);
puts("");
my_print_help(my_long_options); my_print_help(my_long_options);
my_print_variables(my_long_options); my_print_variables(my_long_options);
} }
int main(int argc, char** argv){ int main(int argc, char** argv){
NDB_INIT(argv[0]); NDB_INIT(argv[0]);
const char *load_default_groups[]= { "mysql_cluster",0 };
load_defaults("my",load_default_groups,&argc,&argv); load_defaults("my",load_default_groups,&argc,&argv);
const char* _hostName = NULL; const char* _hostName = NULL;
int ho_error; int ho_error;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment