diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-11-16 15:15:59 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-11-16 15:15:59 +0000 |
commit | f4cf25cebdc982459ba995fe30d9dbd4f54f0626 (patch) | |
tree | 946fc606469c18509ce9b3ba3375f5509882b0cb /doc | |
parent | fcf2c9bce1cdd0d4a13841b99e919ec555b896c1 (diff) | |
download | gdbm-f4cf25cebdc982459ba995fe30d9dbd4f54f0626.tar.gz gdbm-f4cf25cebdc982459ba995fe30d9dbd4f54f0626.tar.bz2 |
Improve testgdbm
* src/mem.c (ealloc_die): Return EXIT_FATAL to the shell.
* src/testgdbm.c: Use emalloc, erealloc and estrdup for memory
allocation.
(syntax_error): New function.
(handler_param): New struct.
(all handlers): Change signature. Take a pointer to struct
handler_param as argument.
(export_handler,import_handler): Handle new formats.
(main): Take first argument to be the file name.
(optab): Remove -f argument. Hide -g, but retain it for
backward compatibility.
* doc/gdbm.texinfo: Update.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/gdbm.texinfo | 36 |
1 files changed, 15 insertions, 21 deletions
diff --git a/doc/gdbm.texinfo b/doc/gdbm.texinfo index ec6701f..9f0af5b 100644 --- a/doc/gdbm.texinfo +++ b/doc/gdbm.texinfo @@ -1627,15 +1627,10 @@ existing @acronym{GDBM} database or to create a new one. @cindex default database, @command{testgdbm} -@cindex @option{-g}, @command{testgdbm} option -@cindex @option{-f}, @command{testgdbm} option -@cindex @option{--file}, @command{testgdbm} option @flindex junk.gdbm -When invoked without options, it tries to open a database file called +When invoked without arguments, it tries to open a database file called @file{junk.gdbm}, located in the current working directory. You can -change this default using the @option{--file} (@option{-f}) command -line option@footnote{For compatibility with earlier versions, the -@option{-g} option acts as an alias to @option{-f}}. This -option takes a single argument, specifying the file name to open, e.g.: +change this default by supplying the name of the database to use as +the only argument to @command{testgdbm}, e.g.: @example -$ testgdbm -f file.db +$ testgdbm file.db @end example @@ -1676,6 +1671,2 @@ Set block size. Set cache size. -@item -f @var{file} -@itemx -g @var{file} -@itemx --file=@var{file} -Operate on @var{file} instead of the default @file{junk.gdbm}. @item -h @@ -1788,8 +1779,10 @@ Delete entry with a given @var{key} @anchor{testgdbm export} -@deffn {command verb} export @var{file-name} [truncate] -@deffnx {command abbrev} e @var{file-name} [truncate] +@deffn {command verb} export @var{file-name} [truncate] [binary|ascii] +@deffnx {command abbrev} e @var{file-name} [truncate] [binary|ascii] Export the database to the flat file @var{file-name}. @xref{Flat files}, for a description of the flat file format and its purposes. This -command will not overwrite an existing file, unless the word -@samp{truncate} is given as its second argument. +command will not overwrite an existing file, unless the argument +@samp{truncate} is also given. Another optional argument determines +the type of dump (@pxref{Flat files}). By default, ASCII dump is +created. @@ -1805,8 +1798,9 @@ Fetch and display a record with the given @var{key}. @anchor{testgdbm import} -@deffn {command verb} import @var{file-name} [replace] -@deffnx {command abbrev} i @var{file-name} [replace] +@deffn {command verb} import @var{file-name} [replace] [nometa] +@deffnx {command abbrev} i @var{file-name} [replace] [nometa] Import data from a flat dump file @var{file-name} (@pxref{Flat files}). If the word @samp{replace} is given -as the second argument, any records with the same keys as the already -existing ones will replace them. +as an argument, any records with the same keys as the already +existing ones will replace them. The word @samp{nometa} turns off +restoring meta-information from the dump file. @end deffn |