From a90a72232c7cf901337d18ab959c96dd192ef7e7 Mon Sep 17 00:00:00 2001 From: robocop Date: Sat, 8 Apr 2006 00:03:50 +0000 Subject: [PATCH] Adjust isql to the full words stated in the IB5 docs for the command line options. --- src/isql/isql.epp | 66 +++++++++++++++++++++-------------------- src/msgs/facilities.sql | 2 +- src/msgs/history.sql | 6 ++++ src/msgs/messages.sql | 12 ++++---- 4 files changed, 47 insertions(+), 39 deletions(-) diff --git a/src/isql/isql.epp b/src/isql/isql.epp index 6c958b7799..cbaf20c17c 100644 --- a/src/isql/isql.epp +++ b/src/isql/isql.epp @@ -172,44 +172,44 @@ enum switch_id { SWITCH_UNKNOWN }; -bool switch_used[SWITCH_UNKNOWN]; - struct switch_info { switch_id id; // switch id const char* text; // canonical switch name unsigned int abbrlen; // minimum abbreviation length switch_argtype argtype; // argument type (SWARG_NONE if none) int usage_id; // message id for usage text - bool allow_dup; // switch can be used more then once + //bool allow_dup; // switch can be used more then once }; -switch_info switches[] = { +const switch_info switches[] = +{ #ifdef DEV_BUILD - { SWITCH_EXTRACTTBL, "xt", 2, SWARG_NONE, -1, false }, + { SWITCH_EXTRACTTBL, "xt", 2, SWARG_NONE, -1 }, #endif - { SWITCH_EXTRACTALL, "a", 1, SWARG_NONE, 11, false }, - { SWITCH_BAIL, "bail", 1, SWARG_NONE, 104, false }, - { SWITCH_CACHE, "cache", 1, SWARG_INTEGER, 111, false }, - { SWITCH_CHARSET, "charset", 2, SWARG_STRING, 122, false }, - { SWITCH_DATABASE, "d", 1, SWARG_STRING, 123, false }, - { SWITCH_ECHO, "echo", 1, SWARG_NONE, 124, false }, - { SWITCH_EXTRACT, "extract", 2, SWARG_NONE, 125, false }, - { SWITCH_INPUT, "input", 1, SWARG_STRING, 126, true }, - { SWITCH_MERGE, "merge", 1, SWARG_NONE, 127, false }, - { SWITCH_MERGE2, "m2", 2, SWARG_NONE, 128, false }, - { SWITCH_NOAUTOCOMMIT, "noautocommit", 1, SWARG_NONE, 129, false }, - { SWITCH_NOWARN, "nowarn", 3, SWARG_NONE, 130, false }, - { SWITCH_OUTPUT, "output", 1, SWARG_STRING, 131, false }, - { SWITCH_PAGE, "page", 3, SWARG_INTEGER, 132, false }, - { SWITCH_PASSWORD, "password", 1, SWARG_STRING, 133, false }, - { SWITCH_QUIET, "quiet", 1, SWARG_NONE, 134, false }, - { SWITCH_ROLE, "role", 1, SWARG_STRING, 135, false }, - { SWITCH_ROLE2, "r2", 2, SWARG_STRING, 136, false }, - { SWITCH_SQLDIALECT, "sqldialect", 1, SWARG_INTEGER, 137, false }, - { SWITCH_TERM, "term", 1, SWARG_STRING, 138, false }, - { SWITCH_USER, "user", 1, SWARG_STRING, 139, false }, - { SWITCH_EXTRACT, "x", 1, SWARG_NONE, 140, false }, - { SWITCH_VERSION, "z", 1, SWARG_NONE, 141, false } + { SWITCH_EXTRACTALL, "all", 1, SWARG_NONE, 11 }, + { SWITCH_BAIL, "bail", 1, SWARG_NONE, 104 }, + { SWITCH_CACHE, "cache", 1, SWARG_INTEGER, 111 }, + { SWITCH_CHARSET, "charset", 2, SWARG_STRING, 122 }, + { SWITCH_DATABASE, "database", 1, SWARG_STRING, 123 }, + { SWITCH_ECHO, "echo", 1, SWARG_NONE, 124 }, + { SWITCH_EXTRACT, "extract", 2, SWARG_NONE, 125 }, + { SWITCH_INPUT, "input", 1, SWARG_STRING, 126 }, + { SWITCH_MERGE, "merge", 1, SWARG_NONE, 127 }, + { SWITCH_MERGE2, "m2", 2, SWARG_NONE, 128 }, + { SWITCH_NOAUTOCOMMIT, "noautocommit", 1, SWARG_NONE, 129 }, + { SWITCH_NOWARN, "nowarnings", 3, SWARG_NONE, 130 }, + { SWITCH_OUTPUT, "output", 1, SWARG_STRING, 131 }, + { SWITCH_PAGE, "pagelength", 3, SWARG_INTEGER, 132 }, + { SWITCH_PASSWORD, "password", 1, SWARG_STRING, 133 }, + { SWITCH_QUIET, "quiet", 1, SWARG_NONE, 134 }, + { SWITCH_ROLE, "role", 1, SWARG_STRING, 135 }, + { SWITCH_ROLE2, "r2", 2, SWARG_STRING, 136 }, + { SWITCH_SQLDIALECT, "sqldialect", 1, SWARG_INTEGER, 137 }, + { SWITCH_SQLDIALECT, "sql_dialect", 1, SWARG_INTEGER, -1 }, + { SWITCH_TERM, "terminator", 1, SWARG_STRING, 138 }, + { SWITCH_USER, "user", 1, SWARG_STRING, 139 }, + { SWITCH_EXTRACT, "x", 1, SWARG_NONE, 140 }, + { SWITCH_VERSION, "z", 1, SWARG_NONE, 141 } }; @@ -234,7 +234,8 @@ static inline int fb_isspace(const SSHORT c) } -class indev { +class indev +{ public: indev* indev_next; FILE* indev_fpointer; @@ -5564,8 +5565,9 @@ static processing_state parse_arg(int argc, bool istable = false; #endif - for (int j = 0; j < SWITCH_UNKNOWN; j++) { - switch_used[j] = false; + bool switch_used[SWITCH_UNKNOWN]; + for (int su = 0; su < SWITCH_UNKNOWN; ++su) { + switch_used[su] = false; } int i = 1; @@ -5585,7 +5587,7 @@ static processing_state parse_arg(int argc, if (!fb_utils::strnicmp(s + 1, switches[j].text, swlen) && (swlen >= switches[j].abbrlen)) { swid = switches[j].id; - if (switch_used[swid] && !switches[j].allow_dup) + if (switch_used[swid]) // && !switches[j].allow_dup { ISQL_msg_get(USAGE_DUPSW, errbuf, s + 1); STDERROUT(errbuf); diff --git a/src/msgs/facilities.sql b/src/msgs/facilities.sql index a9918ca934..2bbe833e76 100644 --- a/src/msgs/facilities.sql +++ b/src/msgs/facilities.sql @@ -22,7 +22,7 @@ INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('20 /* INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('1996-11-07 13:38:43', 'GJRN', 16, 241); */ -INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2006-03-26 21:42:44', 'ISQL', 17, 147); +INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2006-07-07 03:07:09', 'ISQL', 17, 147); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('1998-11-04 11:06:15', 'GSEC', 18, 91); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2002-03-05 02:30:12', 'LICENSE', 19, 60); INSERT INTO FACILITIES (LAST_CHANGE, FACILITY, FAC_CODE, MAX_NUMBER) VALUES ('2002-03-05 02:31:54', 'DOS', 20, 74); diff --git a/src/msgs/history.sql b/src/msgs/history.sql index 990df3b390..ffe01ef6bc 100644 --- a/src/msgs/history.sql +++ b/src/msgs/history.sql @@ -1170,6 +1170,12 @@ INSERT INTO HISTORY (CHANGE_NUMBER, CHANGE_WHO, CHANGE_DATE, FAC_CODE, NUMBER, O INSERT INTO HISTORY (CHANGE_NUMBER, CHANGE_WHO, CHANGE_DATE, FAC_CODE, NUMBER, OLD_TEXT, OLD_ACTION, OLD_EXPLANATION, LOCALE) VALUES (1167, 'mkubecek', '2006-03-26 13:08:09', 17, 142, 'missing argument of switch "%s"', NULL, NULL, 'c_pg'); INSERT INTO HISTORY (CHANGE_NUMBER, CHANGE_WHO, CHANGE_DATE, FAC_CODE, NUMBER, OLD_TEXT, OLD_ACTION, OLD_EXPLANATION, LOCALE) VALUES (1168, 'mkubecek', '2006-03-26 13:08:09', 17, 143, 'argument "%s" is not an integer', NULL, NULL, 'c_pg'); INSERT INTO HISTORY (CHANGE_NUMBER, CHANGE_WHO, CHANGE_DATE, FAC_CODE, NUMBER, OLD_TEXT, OLD_ACTION, OLD_EXPLANATION, LOCALE) VALUES (1169, 'mkubecek', '2006-03-26 13:08:09', 17, 144, 'value "%s" is out of range', NULL, NULL, 'c_pg'); +INSERT INTO HISTORY (CHANGE_NUMBER, CHANGE_WHO, CHANGE_DATE, FAC_CODE, NUMBER, OLD_TEXT, OLD_ACTION, OLD_EXPLANATION, LOCALE) VALUES (1170, 'cvc', '2006-07-07 03:00:00', 17, 11, ' -a extract metadata incl. legacy non-SQL tables', NULL, NULL, 'c_pg'); +INSERT INTO HISTORY (CHANGE_NUMBER, CHANGE_WHO, CHANGE_DATE, FAC_CODE, NUMBER, OLD_TEXT, OLD_ACTION, OLD_EXPLANATION, LOCALE) VALUES (1171, 'cvc', '2006-07-07 03:02:10', 17, 123, ' -d database name to put in script creation', NULL, NULL, 'c_pg'); +INSERT INTO HISTORY (CHANGE_NUMBER, CHANGE_WHO, CHANGE_DATE, FAC_CODE, NUMBER, OLD_TEXT, OLD_ACTION, OLD_EXPLANATION, LOCALE) VALUES (1172, 'cvc', '2006-07-07 03:03:03', 17, 130, ' -now(arn) do not show warnings', NULL, NULL, 'c_pg'); +INSERT INTO HISTORY (CHANGE_NUMBER, CHANGE_WHO, CHANGE_DATE, FAC_CODE, NUMBER, OLD_TEXT, OLD_ACTION, OLD_EXPLANATION, LOCALE) VALUES (1173, 'cvc', '2006-07-07 03:04:04', 17, 132, ' -pag(e) page length', NULL, NULL, 'c_pg'); +INSERT INTO HISTORY (CHANGE_NUMBER, CHANGE_WHO, CHANGE_DATE, FAC_CODE, NUMBER, OLD_TEXT, OLD_ACTION, OLD_EXPLANATION, LOCALE) VALUES (1174, 'cvc', '2006-07-07 03:05:25', 17, 137, ' -s SQL dialect (set sql dialect)', NULL, NULL, 'c_pg'); +INSERT INTO HISTORY (CHANGE_NUMBER, CHANGE_WHO, CHANGE_DATE, FAC_CODE, NUMBER, OLD_TEXT, OLD_ACTION, OLD_EXPLANATION, LOCALE) VALUES (1175, 'cvc', '2006-07-07 03:07:09', 17, 138, ' -t(erm) command terminator (set term)', NULL, NULL, 'c_pg'); COMMIT WORK; diff --git a/src/msgs/messages.sql b/src/msgs/messages.sql index 980696a227..80bfbc140b 100644 --- a/src/msgs/messages.sql +++ b/src/msgs/messages.sql @@ -3003,26 +3003,26 @@ INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FL INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('tra_num_exc', 'bump_transaction_id', 'tra.cpp', NULL, 0, 544, NULL, 'Transactions count exceeded. Perform backup and restore to make database operable again', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('NO_TRIGGER', 'SHOW_metadata', 'show.epp', NULL, 17, 121, NULL, 'There is no trigger %s in this database', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE', 'ISQL_main', 'isql.epp', NULL, 17, 1, NULL, 'usage: isql [options] []', NULL, NULL); -INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_ALL', 'ISQL_main', 'isql.epp', NULL, 17, 11, NULL, ' -a extract metadata incl. legacy non-SQL tables', NULL, NULL); +INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_ALL', 'ISQL_main', 'isql.epp', NULL, 17, 11, NULL, ' -a(all) extract metadata incl. legacy non-SQL tables', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_BAIL', 'ISQL_main', 'isql.epp', NULL, 17, 104, NULL, ' -b(ail) bail on errors (set bail on)', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_CACHE', 'ISQL_main', 'isql.epp', NULL, 17, 111, NULL, ' -c(ache) number of cache buffers', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_CHARSET', 'ISQL_main', 'isql.epp', NULL, 17, 122, NULL, ' -ch(arset) connection charset (set names)', NULL, NULL); -INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_DATABASE', 'ISQL_main', 'isql.epp', NULL, 17, 123, NULL, ' -d database name to put in script creation', NULL, NULL); +INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_DATABASE', 'ISQL_main', 'isql.epp', NULL, 17, 123, NULL, ' -d(atabase) database name to put in script creation', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_ECHO', 'ISQL_main', 'isql.epp', NULL, 17, 124, NULL, ' -e(cho) echo commands (set echo on)', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_EXTRACT', 'ISQL_main', 'isql.epp', NULL, 17, 125, NULL, ' -ex(tract) extract metadata', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_INPUT', 'ISQL_main', 'isql.epp', NULL, 17, 126, NULL, ' -i(nput) input file (set input)', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_MERGE', 'ISQL_main', 'isql.epp', NULL, 17, 127, NULL, ' -m(erge) merge standard error', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_MERGE2', 'ISQL_main', 'isql.epp', NULL, 17, 128, NULL, ' -m2 merge diagnostic', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_NOAUTOCOMMIT', 'ISQL_main', 'isql.epp', NULL, 17, 129, NULL, ' -n(oautocommit) no autocommit DDL (set autoddl off)', NULL, NULL); -INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_NOWARN', 'ISQL_main', 'isql.epp', NULL, 17, 130, NULL, ' -now(arn) do not show warnings', NULL, NULL); +INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_NOWARN', 'ISQL_main', 'isql.epp', NULL, 17, 130, NULL, ' -now(arnings) do not show warnings', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_OUTPUT', 'ISQL_main', 'isql.epp', NULL, 17, 131, NULL, ' -o(utput) output file (set output)', NULL, NULL); -INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_PAGE', 'ISQL_main', 'isql.epp', NULL, 17, 132, NULL, ' -pag(e) page length', NULL, NULL); +INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_PAGE', 'ISQL_main', 'isql.epp', NULL, 17, 132, NULL, ' -pag(elength) page length', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_PASSWORD', 'ISQL_main', 'isql.epp', NULL, 17, 133, NULL, ' -p(assword) connection password', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_QUIET', 'ISQL_main', 'isql.epp', NULL, 17, 134, NULL, ' -q(uiet) do not show the message "Use CONNECT..."', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_ROLE', 'ISQL_main', 'isql.epp', NULL, 17, 135, NULL, ' -r(ole) role name', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_ROLE2', 'ISQL_main', 'isql.epp', NULL, 17, 136, NULL, ' -r2 role (uses quoted identifier)', NULL, NULL); -INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_SQLDIALECT', 'ISQL_main', 'isql.epp', NULL, 17, 137, NULL, ' -s SQL dialect (set sql dialect)', NULL, NULL); -INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_TERM', 'ISQL_main', 'isql.epp', NULL, 17, 138, NULL, ' -t(erm) command terminator (set term)', NULL, NULL); +INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_SQLDIALECT', 'ISQL_main', 'isql.epp', NULL, 17, 137, NULL, ' -sqldialect SQL dialect (set sql dialect)', NULL, NULL); +INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_TERM', 'ISQL_main', 'isql.epp', NULL, 17, 138, NULL, ' -t(erminator) command terminator (set term)', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_USER', 'ISQL_main', 'isql.epp', NULL, 17, 139, NULL, ' -u(ser) user name', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_XTRACT', 'ISQL_main', 'isql.epp', NULL, 17, 140, NULL, ' -x extract metadata', NULL, NULL); INSERT INTO MESSAGES (SYMBOL, ROUTINE, MODULE, TRANS_NOTES, FAC_CODE, NUMBER, FLAGS, TEXT, "ACTION", EXPLANATION) VALUES ('USAGE_VERSION', 'ISQL_main', 'isql.epp', NULL, 17, 141, NULL, ' -z show program and server version', NULL, NULL);