diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-05-08 16:27:01 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2013-05-08 16:27:01 +0000 |
commit | 6658f41e38fec9e007a0fbd0883e030f6337e28d (patch) | |
tree | d7ecc0b72b23a01a2bfa10e8a7bb184d704269dc /doc/gdbm.texinfo | |
parent | c0cba983ab0c0bc1de630a200f902189ddddff09 (diff) | |
download | gdbm-6658f41e38fec9e007a0fbd0883e030f6337e28d.tar.gz gdbm-6658f41e38fec9e007a0fbd0883e030f6337e28d.tar.bz2 |
Rename testgdbm to gdbmtool. Improve documentation.
* configure.ac: Fix a typo.
* src/.cvsignore: Add gdbmtool
* src/Makefile.am: Rename testgdbm to gdbmtool. Source
file not renamed because of CVS deficiency.
* src/gdbm_dump.c: Enable NLS.
* src/gdbm_load.c: Likewise.
* src/testgdbm.c: New option -q (--quiet).
New command: prompt.
* doc/Makefile.am (man_MANS): Add new manpages.
* doc/gdbmtool.1: New file.
* doc/gdbm_load.1: New file.
* doc/gdbm_dump.1: New file.
* doc/gdbm.3: Update.
* doc/gdbm.texinfo: Update.
Diffstat (limited to 'doc/gdbm.texinfo')
-rw-r--r-- | doc/gdbm.texinfo | 134 |
1 files changed, 65 insertions, 69 deletions
diff --git a/doc/gdbm.texinfo b/doc/gdbm.texinfo index 9f0af5b..17f47f9 100644 --- a/doc/gdbm.texinfo +++ b/doc/gdbm.texinfo | |||
@@ -118,7 +118,7 @@ Functions: | |||
118 | 118 | ||
119 | Programs | 119 | Programs |
120 | 120 | ||
121 | * testgdbm:: Test and modify a GDBM database. | 121 | * gdbmtool:: Examine and modify a GDBM database. |
122 | * gdbm_dump:: Dump the database into a flat file. | 122 | * gdbm_dump:: Dump the database into a flat file. |
123 | * gdbm_load:: Load the database from a flat file. | 123 | * gdbm_load:: Load the database from a flat file. |
124 | * gdbmexport:: Export a database into a portable format. | 124 | * gdbmexport:: Export a database into a portable format. |
@@ -1617,35 +1617,35 @@ memory managed by the compatibility library. The application should | |||
1617 | never free it. | 1617 | never free it. |
1618 | @end deftypefn | 1618 | @end deftypefn |
1619 | 1619 | ||
1620 | @node testgdbm | 1620 | @node gdbmtool |
1621 | @chapter Test and modify a GDBM database. | 1621 | @chapter Examine and modify a GDBM database. |
1622 | @prindex testgdbm | 1622 | @prindex gdbmtool |
1623 | 1623 | ||
1624 | The @command{testgdbm} utility allows you to view and modify an | 1624 | The @command{gdbmtool} utility allows you to view and modify an |
1625 | existing @acronym{GDBM} database or to create a new one. | 1625 | existing @acronym{GDBM} database or to create a new one. |
1626 | 1626 | ||
1627 | @cindex default database, @command{testgdbm} | 1627 | @cindex default database, @command{gdbmtool} |
1628 | @flindex junk.gdbm | 1628 | @flindex junk.gdbm |
1629 | When invoked without arguments, it tries to open a database file called | 1629 | When invoked without arguments, it tries to open a database file called |
1630 | @file{junk.gdbm}, located in the current working directory. You can | 1630 | @file{junk.gdbm}, located in the current working directory. You can |
1631 | change this default by supplying the name of the database to use as | 1631 | change this default by supplying the name of the database to use as |
1632 | the only argument to @command{testgdbm}, e.g.: | 1632 | the only argument to @command{gdbmtool}, e.g.: |
1633 | 1633 | ||
1634 | @example | 1634 | @example |
1635 | $ testgdbm file.db | 1635 | $ gdbmtool file.db |
1636 | @end example | 1636 | @end example |
1637 | 1637 | ||
1638 | @cindex read-only mode, @command{testgdbm} | 1638 | @cindex read-only mode, @command{gdbmtool} |
1639 | @cindex @option{-r}, @command{testgdbm} option | 1639 | @cindex @option{-r}, @command{gdbmtool} option |
1640 | @cindex @option{--read-only}, @command{testgdbm} option | 1640 | @cindex @option{--read-only}, @command{gdbmtool} option |
1641 | The database will be opened in read-write mode, unless the | 1641 | The database will be opened in read-write mode, unless the |
1642 | @option{-r} (@option{--read-only}) option is specified, in which case | 1642 | @option{-r} (@option{--read-only}) option is specified, in which case |
1643 | it will be opened only for reading. | 1643 | it will be opened only for reading. |
1644 | 1644 | ||
1645 | @cindex creating a database, @command{testgdbm} | 1645 | @cindex creating a database, @command{gdbmtool} |
1646 | @cindex @option{-n}, @command{testgdbm} option | 1646 | @cindex @option{-n}, @command{gdbmtool} option |
1647 | @cindex @option{--newdb}, @command{testgdbm} option | 1647 | @cindex @option{--newdb}, @command{gdbmtool} option |
1648 | If the database does not exist, @command{testgdbm} will create it. | 1648 | If the database does not exist, @command{gdbmtool} will create it. |
1649 | There is a special option @option{-n} (@option{--newdb}, which | 1649 | There is a special option @option{-n} (@option{--newdb}, which |
1650 | instructs the utility to create a new database. If it is used and if | 1650 | instructs the utility to create a new database. If it is used and if |
1651 | the database already exists, it will be deleted, so use it sparingly. | 1651 | the database already exists, it will be deleted, so use it sparingly. |
@@ -1656,10 +1656,10 @@ the database already exists, it will be deleted, so use it sparingly. | |||
1656 | @end menu | 1656 | @end menu |
1657 | 1657 | ||
1658 | @node invocation | 1658 | @node invocation |
1659 | @section testgdbm invocation | 1659 | @section gdbmtool invocation |
1660 | @cindex command line options, @command{testgdbm} | 1660 | @cindex command line options, @command{gdbmtool} |
1661 | 1661 | ||
1662 | The following table summarizes all @command{testgdbm} command line | 1662 | The following table summarizes all @command{gdbmtool} command line |
1663 | options: | 1663 | options: |
1664 | 1664 | ||
1665 | @table @option | 1665 | @table @option |
@@ -1681,6 +1681,9 @@ Disable file locking. | |||
1681 | @item -m | 1681 | @item -m |
1682 | @itemx --no-mmap | 1682 | @itemx --no-mmap |
1683 | Disable mmap. | 1683 | Disable mmap. |
1684 | @item -q | ||
1685 | @itemx --quiet | ||
1686 | Don't print the usual welcome banner at startup. | ||
1684 | @item -r | 1687 | @item -r |
1685 | @itemx --read-only | 1688 | @itemx --read-only |
1686 | Open the database in read-only mode. | 1689 | Open the database in read-only mode. |
@@ -1696,23 +1699,23 @@ command line options. | |||
1696 | @end table | 1699 | @end table |
1697 | 1700 | ||
1698 | @node shell | 1701 | @node shell |
1699 | @section testgdbm interactive mode | 1702 | @section gdbmtool interactive mode |
1700 | @cindex interactive mode, @command{testgdbm} | 1703 | @cindex interactive mode, @command{gdbmtool} |
1701 | 1704 | ||
1702 | After successful startup, @command{testgdbm} starts a loop, in which | 1705 | After successful startup, @command{gdbmtool} starts a loop, in which |
1703 | it reads commands from the user, executes them and prints the results | 1706 | it reads commands from the user, executes them and prints the results |
1704 | on the standard output. If the standard input is attached to a console, | 1707 | on the standard output. If the standard input is attached to a console, |
1705 | @command{testgdbm} runs in interactive mode, which is indicated by its | 1708 | @command{gdbmtool} runs in interactive mode, which is indicated by its |
1706 | @dfn{prompt}: | 1709 | @dfn{prompt}: |
1707 | 1710 | ||
1708 | @example | 1711 | @example |
1709 | testgdbm> _ | 1712 | gdbmtool> _ |
1710 | @end example | 1713 | @end example |
1711 | 1714 | ||
1712 | The utility finishes when it reads the @samp{quit} command (see below) or | 1715 | The utility finishes when it reads the @samp{quit} command (see below) or |
1713 | detects end-of-file on its standard input, whichever occurs first. | 1716 | detects end-of-file on its standard input, whichever occurs first. |
1714 | 1717 | ||
1715 | A @command{testgdbm} command consists of a @dfn{command verb}, | 1718 | A @command{gdbmtool} command consists of a @dfn{command verb}, |
1716 | optionally followed by one or two @dfn{arguments}, separated by any | 1719 | optionally followed by one or two @dfn{arguments}, separated by any |
1717 | amount of white space. A command verb can be entered either in full | 1720 | amount of white space. A command verb can be entered either in full |
1718 | or in an abbreviated form, as long as that abbreviation does not match | 1721 | or in an abbreviated form, as long as that abbreviation does not match |
@@ -1727,35 +1730,35 @@ space. This limitation will be removed in future releases. | |||
1727 | 1730 | ||
1728 | Each command takes at most two @dfn{formal parameters}, which can be | 1731 | Each command takes at most two @dfn{formal parameters}, which can be |
1729 | optional or mandatory. If the number of actual arguments is less than the | 1732 | optional or mandatory. If the number of actual arguments is less than the |
1730 | number of mandatory parameters, @command{testgdbm} will prompt you to | 1733 | number of mandatory parameters, @command{gdbmtool} will prompt you to |
1731 | supply missing arguments. For example, the @samp{store} command takes two | 1734 | supply missing arguments. For example, the @samp{store} command takes two |
1732 | mandatory parameters, so if you invoked it with no arguments, you | 1735 | mandatory parameters, so if you invoked it with no arguments, you |
1733 | would be prompted twice to supply the necessary data, as shown in | 1736 | would be prompted twice to supply the necessary data, as shown in |
1734 | example below: | 1737 | example below: |
1735 | 1738 | ||
1736 | @example | 1739 | @example |
1737 | testgdbm> @kbd{store} | 1740 | gdbmtool> @kbd{store} |
1738 | key> @kbd{three} | 1741 | key> @kbd{three} |
1739 | data> @kbd{3} | 1742 | data> @kbd{3} |
1740 | @end example | 1743 | @end example |
1741 | 1744 | ||
1742 | However, such prompting is possible only in interactive mode. In | 1745 | However, such prompting is possible only in interactive mode. In |
1743 | non-interactive mode (e.g.@: when running a script), all arguments must | 1746 | non-interactive mode (e.g.@: when running a script), all arguments must |
1744 | be supplied with each command, otherwise @command{testgdbm} will report an | 1747 | be supplied with each command, otherwise @command{gdbmtool} will report an |
1745 | error and exit immediately. | 1748 | error and exit immediately. |
1746 | 1749 | ||
1747 | @anchor{pager} | 1750 | @anchor{pager} |
1748 | @cindex pager, @command{testgdbm} | 1751 | @cindex pager, @command{gdbmtool} |
1749 | @cindex @env{PAGER} | 1752 | @cindex @env{PAGER} |
1750 | Some commands produce excessive amounts of output. To help you follow | 1753 | Some commands produce excessive amounts of output. To help you follow |
1751 | it, @command{testgdbm} uses a pager utility to display such | 1754 | it, @command{gdbmtool} uses a pager utility to display such |
1752 | output. The name of the pager utility is taken from the environment | 1755 | output. The name of the pager utility is taken from the environment |
1753 | variable @env{PAGER}. The pager is invoked only in interactive mode | 1756 | variable @env{PAGER}. The pager is invoked only in interactive mode |
1754 | and only if the estimated number of output lines is greater then the | 1757 | and only if the estimated number of output lines is greater then the |
1755 | number of lines on your screen. | 1758 | number of lines on your screen. |
1756 | 1759 | ||
1757 | @anchor{nul-termination} | 1760 | @anchor{nul-termination} |
1758 | Many of the @command{testgdbm} commands operate on database key and | 1761 | Many of the @command{gdbmtool} commands operate on database key and |
1759 | data values. The utility assumes that both keys and data are | 1762 | data values. The utility assumes that both keys and data are |
1760 | @acronym{ASCII} strings, either nul-terminated or not. By default, | 1763 | @acronym{ASCII} strings, either nul-terminated or not. By default, |
1761 | it is assumed that strings are nul-terminated. You can change this | 1764 | it is assumed that strings are nul-terminated. You can change this |
@@ -1765,39 +1768,36 @@ by using @code{z} (@code{key-zero}, for keys) and @code{Z} | |||
1765 | The following table summarizes all available commands: | 1768 | The following table summarizes all available commands: |
1766 | 1769 | ||
1767 | @deffn {command verb} count | 1770 | @deffn {command verb} count |
1768 | @deffnx {command abbrev} co | ||
1769 | @deffnx {command letter} c | 1771 | @deffnx {command letter} c |
1770 | Print the number of entries in the database. | 1772 | Print the number of entries in the database. |
1771 | @end deffn | 1773 | @end deffn |
1772 | 1774 | ||
1773 | @deffn {command verb} delete @var{key} | 1775 | @deffn {command verb} delete @var{key} |
1774 | @deffnx {command abbrev} de @var{key} | ||
1775 | @deffnx {command letter} d @var{key} | 1776 | @deffnx {command letter} d @var{key} |
1776 | Delete entry with a given @var{key} | 1777 | Delete entry with the given @var{key} |
1777 | @end deffn | 1778 | @end deffn |
1778 | 1779 | ||
1779 | @anchor{testgdbm export} | 1780 | @anchor{gdbmtool export} |
1780 | @deffn {command verb} export @var{file-name} [truncate] [binary|ascii] | 1781 | @deffn {command verb} export @var{file-name} [truncate] [binary|ascii] |
1781 | @deffnx {command abbrev} e @var{file-name} [truncate] [binary|ascii] | 1782 | @deffnx {command letter} e @var{file-name} [truncate] [binary|ascii] |
1782 | Export the database to the flat file @var{file-name}. @xref{Flat files}, | 1783 | Export the database to the flat file @var{file-name}. @xref{Flat files}, |
1783 | for a description of the flat file format and its purposes. This | 1784 | for a description of the flat file format and its purposes. This |
1784 | command will not overwrite an existing file, unless the argument | 1785 | command will not overwrite an existing file, unless the |
1785 | @samp{truncate} is also given. Another optional argument determines | 1786 | @samp{truncate} parameter is also given. Another optional argument |
1786 | the type of dump (@pxref{Flat files}). By default, ASCII dump is |