Decrease POSIX required level to 1

One can now compile with CFLAGS="-std=c99 -D_POSIX_C_SOURCE=1 -pedantic"

Trade getopt.h function for glib equivalents:
This mean all utilities now have long option names.
Adjust manuals and bash_completion accordingly.

Added missing manual and bash_completion for mdb-import.
This commit is contained in:
Nirgal Vourgère
2014-12-29 13:10:01 +01:00
parent 2a70e16a8b
commit 072f7c6518
20 changed files with 480 additions and 414 deletions

View File

@@ -6,15 +6,16 @@ PRODUCT = MDBTools
dist_man_MANS =
if ENABLE_MAN
dist_man_MANS += mdb-tables.1 mdb-ver.1 mdb-export.1 mdb-schema.1 mdb-sql.1 \
mdb-array.1 mdb-header.1 mdb-hexdump.1 mdb-parsecsv.1 mdb-prop.1 gmdb2.1
mdb-array.1 mdb-header.1 mdb-hexdump.1 mdb-parsecsv.1 mdb-prop.1 mdb-import.1 \
gmdb2.1
endif
if ENABLE_DOCBOOK
dist_man_MANS += install.tgz
endif
CLEANFILES = ${dist_man_MANS} install install.tgz
EXTRA_DIST = mdb-tables.txt mdb-ver.txt mdb-export.txt mdb-schema.txt mdb-sql.txt \
mdb-array.txt mdb-header.txt mdb-hexdump.txt mdb-parsecsv.txt mdb-prop.txt gmdb2.txt \
faq.html install.sgml
mdb-array.txt mdb-header.txt mdb-hexdump.txt mdb-parsecsv.txt mdb-prop.txt mdb-import.txt \
gmdb2.txt faq.html install.sgml
.txt.1:
$(TXT2MAN) -t $* -r "$(PRODUCT) $(VERSION)" -s 1 -v "Executable programs or shell commands" $(srcdir)/$< > $@

View File

@@ -23,7 +23,7 @@ ENVIRONMENT
SEE ALSO
mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-ver(1) mdb-array(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) mdb-import(1)
AUTHORS

View File

@@ -26,7 +26,7 @@ ENVIRONMENT
SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-ver(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) mdb-import(1)
AUTHORS
The mdb-array utility was written by Brian Bruns.

View File

@@ -2,7 +2,8 @@ NAME
mdb-export - Export data in an MDB database table to CSV format.
SYNOPSIS
mdb-export [-H] [-d delimiter] [-R row_delim] [[-Q] | [-q quote [-X escape]]] [-I backend] [-D format] [-N namespace] [-b strip|raw|octal] database table
mdb-export [-H] [-d delim] [-R delim] [[-Q] | [-q char [-X char]]] [-I backend] [-D fmt] [-N prefix] [-b strip|raw|octal] database table
mdb-export -h|--help
DESCRIPTION
mdb-export is a utility program distributed with MDB Tools.
@@ -10,17 +11,16 @@ DESCRIPTION
It produces a CSV (comma separated value) output for the given table. Such output is suitable for importation into databases or spreadsheets.
OPTIONS
-H Suppress header row
-Q Don't wrap text-like fields (text, memo, date) in quotes. If not specified text fiels will be surrounded by " (double quote) characters.
-d Specify an alternative column delimiter If no delimiter is specified, table names will be delimited by a , (comma) character.
-R Specify a row delimiter
-I backend INSERT statements (instead of CSV). You must specify which SQL backend dialect to use. Allowed values are: access, sybase, oracle, postgres, mysql and sqlite.
-D Set the date format (see strftime(3) for details)
-q Use to wrap text-like fields. Default is ".
-X Use to escape quoted characters within a field. Default is doubling.
-N namespace Prefix identifiers with namespace.
-b strip|raw|octal Binary export mode: strip binaries, export as-is, or output \ooo style octal data.
-H, --no-header Suppress header row.
-Q, --no-quote Don't wrap text-like fields (text, memo, date) in quotes. If not specified text fiels will be surrounded by " (double quote) characters.
-d, --delimiter delim Specify an alternative column delimiter. Default is , (comma).
-R, --row-delimiter delim Specify a row delimiter. Default is \n (ASCII value 10).
-I, --insert backend INSERT statements (instead of CSV). You must specify which SQL backend dialect to use. Allowed values are: access, sybase, oracle, postgres, mysql and sqlite.
-D, --date-format fmt Set the date format (see strftime(3) for details).
-q, --quote char Use to wrap text-like fields. Default is " (double quote).
-X, --escape char Use to escape quoted characters within a field. Default is doubling.
-N, --namespace prefix Prefix identifiers with prefix.
-b, --bin strip|raw|octal Binary export mode: strip binaries, export as-is, or output \ooo style octal data.
NOTES
@@ -40,7 +40,7 @@ ENVIRONMENT
SEE ALSO
gmdb2(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-ver(1) mdb-array(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) mdb-import(1)
HISTORY
mdb-export first appeared in MDB Tools 0.1.

View File

@@ -31,7 +31,7 @@ EXIT STATUS
SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-ver(1)
mdb-array(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1)
mdb-array(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) mdb-import(1)
AUTHORS
The mdb-header utility was written by Brian Bruns.

View File

@@ -25,7 +25,7 @@ ENVIRONMENT
SEE ALSO
gmdb2(1) mdb-export(1) mdb-prop(1) mdb-sql(1) mdb-ver(1) mdb-array(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) mdb-import(1)
AUTHORS
The mdb-hexdump utility was written by Brian Bruns.

44
doc/mdb-import.txt Normal file
View File

@@ -0,0 +1,44 @@
NAME
mdb-import - Import CSV data into an MDB database.
SYNOPSIS
mdb-import [-H lines] [-d char] database table csvfile
mdb-import -h|--help
DESCRIPTION
mdb-import is a utility program distributed with MDB Tools.
It reads a CSV (comma separated value) file and add the data into table of database.
OPTIONS
-H, --header lines Skip lines of CSV header.
-d, --delimiter char Specify an alternative column delimiter. Default is , (comma).
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
* debug_like
* debug_write
* debug_usage
* debug_ole
* debug_row
* debug_props
* debug_all is a shortcut for all debug_* options
SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-ver(1) mdb-array(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1)
HISTORY
mdb-import first appeared in MDB Tools 0.7.
AUTHORS
The mdb-import utility was written by Brian Bruns.
BUGS
mdb-import does not enforce any kind of checks. You can violate constraints.

View File

@@ -33,7 +33,7 @@ ENVIRONMENT
SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-ver(1)
mdb-array(1) mdb-header(1) mdb-schema(1) mdb-tables(1)
mdb-array(1) mdb-header(1) mdb-schema(1) mdb-tables(1) mdb-import(1)
AUTHORS
The mdb-parsecsv utility was written by Brian Bruns.

View File

@@ -29,7 +29,7 @@ ENVIRONMENT
SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-sql(1) mdb-ver(1) mdb-array(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) mdb-import(1)
AUTHORS
The mdb-prop utility was written by Brian Bruns.

View File

@@ -2,7 +2,8 @@ NAME
mdb-schema - Generate schema creation DDL
SYNOPSIS
mdb-schema [options] database [backend]
mdb-schema [options] [-T tablename] [-N prefix] database [backend]
mdb-schema -h|--help
DESCRIPTION
mdb-schema is a utility program distributed with MDB Tools.
@@ -10,20 +11,20 @@ DESCRIPTION
It produces DDL (data definition language) output for the given database. This can be passed to another database to create a replica of the original access table format.
OPTIONS
-T <table>, --table <table> Single table option. Create schema for this table only. Default is to export all tables.
-N namespace Prefix identifiers with namespace.
--drop-table Issue DROP TABLE statement.
--no-drop-table Don't issue DROP TABLE statement. This is the default.
--not-null Issue NOT NULL constraints. This is the default.
--no-not-null Don't issue NOT NULL constraints.
--default-values Issue DEFAULT values.
--no-default-values Don't issue DEFAULT values. This is the default.
--not-empty Issue CHECK <> '' constraints.
--no-not-empty Don't issue CHECK <> '' constraints. This is the default.
--indexes Export INDEXes. This is the default.
--no-indexes Don't export INDEXes.
--relations Export foreign keys constraints. This is the default.
--no-relations Don't export foreign keys constraints.
-T, --table tablename Single table option. Create schema for this table only. Default is to export all tables.
-N, --namespace prefix Prefix identifiers with namespace.
--drop-table Issue DROP TABLE statement.
--no-drop-table Don't issue DROP TABLE statement. This is the default.
--not-null Issue NOT NULL constraints. This is the default.
--no-not-null Don't issue NOT NULL constraints.
--default-values Issue DEFAULT values.
--no-default-values Don't issue DEFAULT values. This is the default.
--not-empty Issue CHECK <> '' constraints.
--no-not-empty Don't issue CHECK <> '' constraints. This is the default.
--indexes Export INDEXes. This is the default.
--no-indexes Don't export INDEXes.
--relations Export foreign keys constraints. This is the default.
--no-relations Don't export foreign keys constraints.
backend Specifies target DDL dialect. Supported values are access, sybase, oracle, postgres, mysql and sqlite. If not specified the generated DDL will be in access format.
@@ -48,7 +49,7 @@ HISTORY
SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-ver(1)
mdb-array(1) mdb-header(1) mdb-parsecsv(1) mdb-tables(1)
mdb-array(1) mdb-header(1) mdb-parsecsv(1) mdb-tables(1) mdb-import(1)
AUTHORS
The mdb-schema utility was written by Brian Bruns and others.

View File

@@ -2,7 +2,8 @@ NAME
mdb-sql - SQL interface to MDB Tools
SYNOPSIS
mdb-sql [-HFp] [-d delimiter] [-i file] [-o file] [database]
mdb-sql [-HFp] [-d char] [-i file] [-o file] [database]
mdb-sql -h|--help
DESCRIPTION
mdb-sql is a utility program distributed with MDB Tools.
@@ -11,30 +12,28 @@ DESCRIPTION
language.
OPTIONS
-H Suppress header row.
-F Suppress footer row.
-p Turn off pretty printing. By default results are printed in an
-H, --no-header Suppress header row.
-F, --no-footer Suppress footer row.
-p, --no-pretty-print Turn off pretty printing. By default results are printed in an
ascii table format which looks nice but is not conducive to manipulating the
output with unix tools. This option prints output plainly in a tab separated
format.
-d Specify an alternative column delimiter. If no delimiter is
-d, --delimiter char Specify an alternative column delimiter. If no delimiter is
specified, columns will be delimited by a tab character if pretty printing
(-p) is turned off. If pretty printing is enabled this option is meaningless.
-i Specify an input file. This option allows an input file containing the SQL to be passed to mdb-sql. See Notes.
-o Specify an output file. This option allows the name of an output file to be used instead of stdout.
-i, --input file Specify an input file. This option allows an input file containing the SQL to be passed to mdb-sql. See Notes.
-o, --output file Specify an output file. This option allows the name of an output file to be used instead of stdout.
COMMANDS
mdb-sql in interactive mode takes some special commands.
connect to <database> If no database was specified on the command line this command is necessary before any querys are issued. It also allows the switching of databases once in the tool.
disconnect Will disconnect from the current database.
go Each batch is sent to the parser using the 'go' command.
reset A batch can be cleared using the 'reset' command.
list tables The list tables command will display a list of available tables in this database, similar to the mdb-tables utility on the command line.
describe table <table> Will display the column information for the specified table.
quit Will exit the tool.
connect to database If no database was specified on the command line this command is necessary before any querys are issued. It also allows the switching of databases once in the tool.
disconnect Will disconnect from the current database.
go Each batch is sent to the parser using the 'go' command.
reset A batch can be cleared using the 'reset' command.
list tables The list tables command will display a list of available tables in this database, similar to the mdb-tables utility on the command line.
describe table <table> Will display the column information for the specified table.
quit Will exit the tool.
SQL LANGUAGE
The currently implemented SQL subset is quite small, supporting only single table queries, no aggregates, and limited support for WHERE clauses. Here is a brief synopsis of the supported language.
@@ -76,8 +75,8 @@ HISTORY
mdb-sql first appeared in MDB Tools 0.3.
SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-ver(1) mdb-array(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) isql(1)
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-import(1) mdb-prop(1) mdb-ver(1)
mdb-array(1) mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1) isql(1)
AUTHORS
The mdb-sql utility was written by Brian Bruns.

View File

@@ -2,7 +2,8 @@ NAME
mdb-tables - Get listing of tables in an MDB database
SYNOPSIS
mdb-tables [-S] [-1 | -d delimiter] database
mdb-tables [-S] [-1 | -d delim] [-t form|table|macro|systable|report|query|linkedtable|module|relationship|dbprop|any|all] [-T] database
mdb-tables -h|--help
DESCRIPTION
mdb-tables is a utility program distributed with MDB Tools.
@@ -10,11 +11,11 @@ DESCRIPTION
It produces a list of tables contained within an MDB database in a format suitable for use in shell scripts.
OPTIONS
-S Show system tables. System tables are generally those beginning with 'MSys'
-1 specifies that the tables should be listed 1 per line.
-d delimiter specifies an alternative delimiter. If no delimiter is specified, table names will be delimited by a tab character, or by newline if the -1 option was specified.
-S, --system Show system tables. System tables are generally those beginning with 'MSys'.
-1, --single-column Specifies that the tables should be listed 1 per line. This is equivalent to --delim \n.
-d, --delimiter delim Specifies an alternative delimiter. If no delimiter is specified, table names will be delimited by a tab character, or by newline if the -1 option was specified.
-t, --type type Filters entries to show alternate types. Autorized values are form, table, macro, systable, report, query, linkedtable, module, relationship, dbprop, any, and all. Default value is table.
-T, --showtype Display the entry type indentifier before each entry.
NOTES
@@ -36,7 +37,7 @@ HISTORY
mdb-tables first appeared in MDB Tools 0.3.
SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-ver(1)
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-import(1) mdb-prop(1) mdb-sql(1) mdb-ver(1)
mdb-array(1) mdb-header(1) mdb-parsecsv(1) mdb-schema(1)
AUTHORS

View File

@@ -4,6 +4,7 @@ NAME
SYNOPSIS
mdb-ver database
mdb-ver -M
mdb-ver -h|--help
DESCRIPTION
mdb-ver is a utility program distributed with MDB Tools.
@@ -12,7 +13,7 @@ DESCRIPTION
OPTIONS
-M Prints the version of MDB Tools itself instead of the MDB file.
-M, --mdbtools Prints the version of MDB Tools itself instead of the MDB file.
NOTES
Access changed its format between Jet 3 used in Access 97 and Jet 4 used for Access 2000 and XP. The nature of the changes included moving the page size from 2K to 4K and added support for unicode. MDB Tools actively supports both formats. Newer version are very much like Jet4.
@@ -35,8 +36,8 @@ HISTORY
mdb-ver first appeared in MDB Tools 0.4.
SEE ALSO
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-prop(1) mdb-sql(1) mdb-array(1)
mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1)
gmdb2(1) mdb-export(1) mdb-hexdump(1) mdb-import(1) mdb-prop(1) mdb-sql(1)
mdb-array(1) mdb-header(1) mdb-parsecsv(1) mdb-schema(1) mdb-tables(1)
AUTHORS
The mdb-ver utility was written by Brian Bruns.