From 8c9165442670f5bced1e705b838a22984987480b Mon Sep 17 00:00:00 2001 From: Evan Miller Date: Tue, 19 Jan 2021 16:27:36 -0500 Subject: [PATCH] Man page and usage updates * MDBOPTS=no_memo is not used anywhere; mark deprecated and print a warning if enabled * Mark MDBOPTS=use_index as experimental in the man pages * MDBOPTS need to be colon separated * Document new long forms of mdb-queries options --- doc/mdb-array.txt | 6 +++--- doc/mdb-count.txt | 6 +++--- doc/mdb-export.txt | 6 +++--- doc/mdb-header.txt | 6 +++--- doc/mdb-hexdump.txt | 6 +++--- doc/mdb-import.txt | 6 +++--- doc/mdb-json.txt | 6 +++--- doc/mdb-parsecsv.txt | 6 +++--- doc/mdb-prop.txt | 6 +++--- doc/mdb-queries.txt | 12 ++++++------ doc/mdb-schema.txt | 6 +++--- doc/mdb-sql.txt | 6 +++--- doc/mdb-tables.txt | 6 +++--- doc/mdb-ver.txt | 6 +++--- src/libmdb/options.c | 4 +++- src/util/mdb-queries.c | 2 +- 16 files changed, 49 insertions(+), 47 deletions(-) diff --git a/doc/mdb-array.txt b/doc/mdb-array.txt index e31075e..c18e4e0 100644 --- a/doc/mdb-array.txt +++ b/doc/mdb-array.txt @@ -13,9 +13,7 @@ DESCRIPTION ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -23,6 +21,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) FUTURE DIRECTIONS mdb-array is deprecated. Soon, it will no longer be distributed. diff --git a/doc/mdb-count.txt b/doc/mdb-count.txt index 43ed180..c586608 100644 --- a/doc/mdb-count.txt +++ b/doc/mdb-count.txt @@ -16,9 +16,7 @@ NOTES ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -26,6 +24,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) HISTORY mdb-count first appeared in MDB Tools 0.9. diff --git a/doc/mdb-export.txt b/doc/mdb-export.txt index cc0a9be..5e726c5 100644 --- a/doc/mdb-export.txt +++ b/doc/mdb-export.txt @@ -36,9 +36,7 @@ NOTES ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset to use for the SQL file. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -46,6 +44,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) SEE ALSO mdb-array(1) mdb-count(1) mdb-header(1) mdb-hexdump(1) diff --git a/doc/mdb-header.txt b/doc/mdb-header.txt index c74e346..013b9c5 100644 --- a/doc/mdb-header.txt +++ b/doc/mdb-header.txt @@ -15,9 +15,7 @@ DESCRIPTION ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -25,6 +23,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) EXIT STATUS mdb-header exits with error code 1 if there was anunsupported type. diff --git a/doc/mdb-hexdump.txt b/doc/mdb-hexdump.txt index 3bf91e5..d54c013 100644 --- a/doc/mdb-hexdump.txt +++ b/doc/mdb-hexdump.txt @@ -12,9 +12,7 @@ DESCRIPTION ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -22,6 +20,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) SEE ALSO mdb-array(1) mdb-count(1) mdb-export(1) mdb-header(1) diff --git a/doc/mdb-import.txt b/doc/mdb-import.txt index a5cb5f6..89e6003 100644 --- a/doc/mdb-import.txt +++ b/doc/mdb-import.txt @@ -19,9 +19,7 @@ NOTES ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the input charset to use for the SQL file. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -29,6 +27,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) SEE ALSO mdb-array(1) mdb-count(1) mdb-export(1) mdb-header(1) mdb-hexdump(1) diff --git a/doc/mdb-json.txt b/doc/mdb-json.txt index e4d0616..df9cac1 100644 --- a/doc/mdb-json.txt +++ b/doc/mdb-json.txt @@ -20,9 +20,7 @@ NOTES ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset to use for the SQL file. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -30,6 +28,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) SEE ALSO mdb-array(1) mdb-count(1) mdb-export(1) mdb-header(1) mdb-hexdump(1) diff --git a/doc/mdb-parsecsv.txt b/doc/mdb-parsecsv.txt index 317819e..1f8b786 100644 --- a/doc/mdb-parsecsv.txt +++ b/doc/mdb-parsecsv.txt @@ -20,9 +20,7 @@ NOTES ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset to use for the SQL file. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -30,6 +28,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) FUTURE DIRECTIONS mdb-parsecsv is deprecated. Soon, it will no longer be distributed. diff --git a/doc/mdb-prop.txt b/doc/mdb-prop.txt index 8b702c1..1f1f3ba 100644 --- a/doc/mdb-prop.txt +++ b/doc/mdb-prop.txt @@ -16,9 +16,7 @@ DESCRIPTION ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -26,6 +24,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) SEE ALSO mdb-array(1) mdb-count(1) mdb-export(1) mdb-header(1) mdb-hexdump(1) diff --git a/doc/mdb-queries.txt b/doc/mdb-queries.txt index 7787a03..d5620a9 100644 --- a/doc/mdb-queries.txt +++ b/doc/mdb-queries.txt @@ -11,18 +11,16 @@ DESCRIPTION It produces a list of queries in the database, and dump the SQL associated with a specific query. OPTIONS - -L List queries in the database (default if no query name is passed) - -1 Use newline as the delimiter (used in conjunction with listing) - -d delim Specify delimiter to use + -L, --list List queries in the database (default if no query name is passed) + -1, --newline Use newline as the delimiter (used in conjunction with listing) + -d, --delimiter delim Specify delimiter to use NOTES ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -30,6 +28,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) HISTORY mdb-queries first appeared in MDB Tools 0.9. diff --git a/doc/mdb-schema.txt b/doc/mdb-schema.txt index 518c40f..ac318b6 100644 --- a/doc/mdb-schema.txt +++ b/doc/mdb-schema.txt @@ -33,9 +33,7 @@ OPTIONS ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset to use for the SQL file. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -43,6 +41,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) NOTES diff --git a/doc/mdb-sql.txt b/doc/mdb-sql.txt index 84ea669..2d1ec84 100644 --- a/doc/mdb-sql.txt +++ b/doc/mdb-sql.txt @@ -60,9 +60,7 @@ NOTES ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -70,6 +68,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) HISTORY mdb-sql first appeared in MDB Tools 0.3. diff --git a/doc/mdb-tables.txt b/doc/mdb-tables.txt index 5295301..93fcaf7 100644 --- a/doc/mdb-tables.txt +++ b/doc/mdb-tables.txt @@ -22,9 +22,7 @@ NOTES ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -32,6 +30,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) HISTORY mdb-tables first appeared in MDB Tools 0.3. diff --git a/doc/mdb-ver.txt b/doc/mdb-ver.txt index 6f5d3e0..4e3888d 100644 --- a/doc/mdb-ver.txt +++ b/doc/mdb-ver.txt @@ -21,9 +21,7 @@ NOTES ENVIRONMENT MDB_JET3_CHARSET Defines the charset of the input JET3 (access 97) file. Default is CP1252. See iconv(1). MDBICONV Defines the output charset. Default is UTF-8. mdbtools must have been compiled with iconv. - MDBOPTS semi-column separated list of options: - * use_index - * no_memo + MDBOPTS Colon-separated list of options: * debug_like * debug_write * debug_usage @@ -31,6 +29,8 @@ ENVIRONMENT * debug_row * debug_props * debug_all is a shortcut for all debug_* options + * no_memo (deprecated; has no effect) + * use_index (experimental; requires libmswstr) HISTORY mdb-ver first appeared in MDB Tools 0.4. diff --git a/src/libmdb/options.c b/src/libmdb/options.c index 0f1a5bd..8d377ff 100644 --- a/src/libmdb/options.c +++ b/src/libmdb/options.c @@ -62,7 +62,9 @@ load_options() fprintf(stderr, "The 'use_index' argument was supplied to MDBOPTS environment variable. However, this feature requires the libmswstr library, which was not found when libmdb was compiled. As a result, the 'use_index' argument will be ignored.\n\nTo enable indexes, you will need to download libmswstr from https://github.com/leecher1337/libmswstr and then recompile libmdb. Note that the 'use_index' feature is largely untested, and may have unexpected results.\n\nTo suppress this warning, run the program again after removing the 'use_index' argument from the MDBOPTS environment variable.\n"); #endif } - if (!strcmp(opt, "no_memo")) opts |= MDB_NO_MEMO; + if (!strcmp(opt, "no_memo")) { + fprintf(stderr, "The 'no_memo' argument was supplied to MDBOPTS environment variable. This argument is deprecated, and has no effect.\n\nTo suppress this warning, run the program again after removing the 'no_memo' argument from the MDBOPTS environment variable.\n"); + } if (!strcmp(opt, "debug_like")) opts |= MDB_DEBUG_LIKE; if (!strcmp(opt, "debug_write")) opts |= MDB_DEBUG_WRITE; if (!strcmp(opt, "debug_usage")) opts |= MDB_DEBUG_USAGE; diff --git a/src/util/mdb-queries.c b/src/util/mdb-queries.c index 3d1ef25..0f67fd8 100644 --- a/src/util/mdb-queries.c +++ b/src/util/mdb-queries.c @@ -75,7 +75,7 @@ int main (int argc, char **argv) { GOptionEntry entries[] = { {"list", 'L', 0, G_OPTION_ARG_NONE, &list_only, "List queries in the database (default if no query name is passed)", NULL}, {"newline", '1', 0, G_OPTION_ARG_NONE, &line_break, "Use newline as the delimiter (used in conjunction with listing)", NULL}, - {"delimiter", 'd', 0, G_OPTION_ARG_STRING, &delimiter, "Specify delimiter to use", "delimiter"}, + {"delimiter", 'd', 0, G_OPTION_ARG_STRING, &delimiter, "Specify delimiter to use", "delim"}, {NULL} }; opt_context = g_option_context_new(" - list or export queries from an Access database");