diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-24 20:30:22 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2011-08-24 20:30:22 +0000 |
commit | 7ea0c0578a59abc086496024dbf6cc65b6e94e38 (patch) | |
tree | e45c89740ba84edbf809efb8aae5fc2447eee580 /doc | |
parent | 51c2a16f2d3658672421892e2c3405c6ed74c490 (diff) | |
download | gdbm-7ea0c0578a59abc086496024dbf6cc65b6e94e38.tar.gz gdbm-7ea0c0578a59abc086496024dbf6cc65b6e94e38.tar.bz2 |
Implement multi-character commands in testgdbm.
* bootstrap (get_po): Discard output from cmp.
* src/testgdbm.c: Implement multi-character commands.
* doc/gdbm.texinfo: Update.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/gdbm.texinfo | 204 |
1 files changed, 122 insertions, 82 deletions
diff --git a/doc/gdbm.texinfo b/doc/gdbm.texinfo index 8487de2..010f6f0 100644 --- a/doc/gdbm.texinfo +++ b/doc/gdbm.texinfo | |||
@@ -1005,18 +1005,24 @@ on the standard output. If the standard input is attached to a console, | |||
1005 | @dfn{prompt}: | 1005 | @dfn{prompt}: |
1006 | 1006 | ||
1007 | @example | 1007 | @example |
1008 | com -> _ | 1008 | testgdbm> _ |
1009 | @end example | 1009 | @end example |
1010 | 1010 | ||
1011 | The utility finishes when it reads the @samp{q} command (see below) or | 1011 | The utility finishes when it reads the @samp{quit} command (see below) or |
1012 | it detects end-of-file on its standard input, whichever occurs first. | 1012 | detects end-of-file on its standard input, whichever occurs first. |
1013 | 1013 | ||
1014 | A @command{testgdbm} command consists of a @dfn{command letter}, | 1014 | A @command{testgdbm} command consists of a @dfn{command verb}, |
1015 | optionally followed by one or two @dfn{arguments}, separated by any | 1015 | optionally followed by one or two @dfn{arguments}, separated by any |
1016 | amount of white space. An argument is any sequence of non-whitespace | 1016 | amount of white space. A command verb can be entered either in full |
1017 | characters. Notice, that currently there is no way to enter arguments | 1017 | or in an abbreviated form, as long as that abbreviation does not match |
1018 | containing white space. This limitation will be removed in future | 1018 | any other verb. For example, @samp{co} can be used instead of |
1019 | releases. | 1019 | @samp{count} and @samp{ca} instead of @samp{cache}. Furthermore, |
1020 | many command verbs also have single-letter forms, called @dfn{command | ||
1021 | letters}. | ||
1022 | |||
1023 | An argument is any sequence of non-whitespace characters. Notice, | ||
1024 | that currently there is no way to enter arguments containing white | ||
1025 | space. This limitation will be removed in future releases. | ||
1020 | 1026 | ||
1021 | Each command letter takes at most two @dfn{formal parameters}, which can be | 1027 | Each command letter takes at most two @dfn{formal parameters}, which can be |
1022 | optional or mandatory. If the number of actual arguments is less than the | 1028 | optional or mandatory. If the number of actual arguments is less than the |
@@ -1027,9 +1033,9 @@ would be prompted twice to supply the necessary data, as shown in | |||
1027 | example below: | 1033 | example below: |
1028 | 1034 | ||
1029 | @example | 1035 | @example |
1030 | com -> @kbd{s} | 1036 | testgdbm> @kbd{s} |
1031 | key -> @kbd{three} | 1037 | key> @kbd{three} |
1032 | data -> @kbd{3} | 1038 | data> @kbd{3} |
1033 | @end example | 1039 | @end example |
1034 | 1040 | ||
1035 | However, such prompting is possible only in interactive mode. In | 1041 | However, such prompting is possible only in interactive mode. In |
@@ -1056,117 +1062,147 @@ by using @code{z} (for keys) and @code{Z} (for data) commands. | |||
1056 | 1062 | ||
1057 | The following table summarizes all available commands: | 1063 | The following table summarizes all available commands: |
1058 | 1064 | ||
1059 | @table @code | 1065 | @deffn {command verb} count |
1060 | @kindex c, testgdbm command | 1066 | @deffnx {command abbrev} co |
1061 | @item c | 1067 | @deffnx {command letter} c |
1062 | Print the number of entries in the database. | 1068 | Print the number of entries in the database. |
1069 | @end deffn | ||
1063 | 1070 | ||
1064 | @kindex d, testgdbm command | 1071 | @deffn {command verb} delete @var{key} |
1065 | @item d @var{key} | 1072 | @deffnx {command abbrev} de @var{key} |
1073 | @deffnx {command letter} d @var{key} | ||
1066 | Delete entry with a given @var{key} | 1074 | Delete entry with a given @var{key} |
1067 | @anchor{testgdbm export} | 1075 | @end deffn |
1068 | 1076 | ||
1069 | @kindex e, testgdbm command | 1077 | @anchor{testgdbm export} |
1070 | @item e @var{file-name} [truncate] | 1078 | @deffn {command verb} export @var{file-name} [truncate] |
1079 | @deffnx {command abbrev} e @var{file-name} [truncate] | ||
1071 | Export the database to the flat file @var{file-name}. @xref{Flat files}, | 1080 | Export the database to the flat file @var{file-name}. @xref{Flat files}, |
1072 | for a description of the flat file format and its purposes. This | 1081 | for a description of the flat file format and its purposes. This |
1073 | command will not overwrite an existing file, unless the word | 1082 | command will not overwrite an existing file, unless the word |
1074 | @samp{truncate} is given as its second argument. | 1083 | @samp{truncate} is given as its second argument. |
1075 | 1084 | ||
1076 | See also @ref{gdbmexport}. | 1085 | See also @ref{gdbmexport}. |
1086 | @end deffn | ||
1077 | 1087 | ||
1078 | @kindex f, testgdbm command | 1088 | @deffn {command verb} fetch @var{key} |
1079 | @item f @var{key} | 1089 | @deffnx {command abbrev} fe @var{key} |
1090 | @deffnx {command letter} f @var{key} | ||
1080 | Fetch and display a record with the given @var{key}. | 1091 | Fetch and display a record with the given @var{key}. |
1092 | @end deffn | ||
1081 | 1093 | ||
1082 | @anchor{testgdbm import} | 1094 | @anchor{testgdbm import} |
1083 | @kindex i, testgdbm command | 1095 | @deffn {command verb} import @var{file-name} [replace] |
1084 | @item i @var{file-name} [replace] | 1096 | @deffnx {command abbrev} i @var{file-name} [replace] |
1085 | Import data from a flat dump file @var{file-name} | 1097 | Import data from a flat dump file @var{file-name} |
1086 | (@pxref{Flat files}). If the word @samp{replace} is given | 1098 | (@pxref{Flat files}). If the word @samp{replace} is given |
1087 | as the second argument, any records with the same keys as the already | 1099 | as the second argument, any records with the same keys as the already |
1088 | existing ones will replace them. | 1100 | existing ones will replace them. |
1101 | @end deffn | ||
1089 | 1102 | ||
1090 | @kindex l, testgdbm command | 1103 | @deffn {command verb} list |
1091 | @item l | 1104 | @deffnx {command abbrev} l |
1092 | List the contents of the database (@pxref{pager}). | 1105 | List the contents of the database (@pxref{pager}). |
1106 | @end deffn | ||
1093 | 1107 | ||
1094 | @kindex n, testgdbm command | 1108 | @deffn {command verb} next [@var{key}] |
1095 | @kindex 2, testgdbm command | 1109 | @deffnx {command abbrev} n [@var{key}] |
1096 | @item n [@var{key}] | ||
1097 | @itemx 2 [@var{key}] | ||
1098 | Sequential access: fetch and display a next record. If @var{key} is | 1110 | Sequential access: fetch and display a next record. If @var{key} is |
1099 | given, a record following one with this key will be fetched. | 1111 | given, a record following one with this key will be fetched. |
1100 | Otherwise, the key supplied by the latest @code{1}, @code{2} or | 1112 | Otherwise, the key supplied by the latest @code{1}, @code{2} or |
1101 | @var{n} command will be used. | 1113 | @var{n} command will be used. |
1102 | 1114 | ||
1103 | The second form, @code{2} is a synonym for @code{n} without arguments. | 1115 | See also @code{first}, below. |
1104 | |||
1105 | See also @code{1}, below. | ||
1106 | 1116 | ||
1107 | @xref{Sequential}, for more information on sequential access. | 1117 | @xref{Sequential}, for more information on sequential access. |
1118 | @end deffn | ||
1108 | 1119 | ||
1109 | @kindex q, testgdbm command | 1120 | @deffn {command verb} quit |
1110 | @item q | 1121 | @deffnx {command abbrev} q |
1111 | Close the database and quit the utility. | 1122 | Close the database and quit the utility. |
1123 | @end deffn | ||
1112 | 1124 | ||
1113 | @kindex s, testgdbm command | 1125 | @deffn {command verb} store @var{key} @var{data} |
1114 | @item s @var{key} @var{data} | 1126 | @deffnx {command abbrev} sto @var{key} @var{data} |
1127 | @deffnx {command letter} s @var{key} @var{data} | ||
1115 | Store the @var{data} with @var{key} in the database. If @var{key} | 1128 | Store the @var{data} with @var{key} in the database. If @var{key} |
1116 | already exists, its data will be replaced. | 1129 | already exists, its data will be replaced. |
1130 | @end deffn | ||
1117 | 1131 | ||
1118 | @kindex 1, testgdbm command | 1132 | @deffn {command verb} first |
1119 | @item 1 | 1133 | @deffnx {command abbrev} fi |
1134 | @deffnx {command letter} 1 | ||
1120 | Fetch and display the first record in the database. Subsequent | 1135 | Fetch and display the first record in the database. Subsequent |
1121 | records can be fetched using @code{n} (or @code{2}) command (see above). | 1136 | records can be fetched using @code{next} command (see above). |
1122 | @xref{Sequential}, for more information on sequential access. | 1137 | @xref{Sequential}, for more information on sequential access. |
1138 | @end deffn | ||
1123 | 1139 | ||
1124 | @kindex <, testgdbm command | 1140 | @deffn {command verb} read @var{file} [replace] |
1125 | @item < @var{file} [replace] | 1141 | @deffnx {command abbrev} rea @var{file} [replace] |
1142 | @deffnx {command letter} < @var{file} [replace] | ||
1126 | Read entries from @var{file} and store them in the database. If the | 1143 | Read entries from @var{file} and store them in the database. If the |
1127 | word @samp{replace} is given as the second argument, any existing | 1144 | word @samp{replace} is given as the second argument, any existing |
1128 | records with matching keys will be replaced. | 1145 | records with matching keys will be replaced. |
1146 | @end deffn | ||
1129 | 1147 | ||
1130 | @kindex r, testgdbm command | 1148 | @deffn {command verb} reorganize |
1131 | @item r | 1149 | @deffnx {command abbrev} reo |
1150 | @deffnx {command letter} r | ||
1132 | Reorganize the database (@pxref{Reorganization}). | 1151 | Reorganize the database (@pxref{Reorganization}). |
1152 | @end deffn | ||
1133 | 1153 | ||
1134 | @kindex z, testgdbm command | 1154 | @deffn {command verb} key-zero |
1135 | @item z | 1155 | @deffnx {command abbrev} k |
1136 | Toggle key nul-termination. Use @code{S} to inspect the current | 1156 | @deffnx {command letter} z |
1157 | Toggle key nul-termination. Use @code{status} to inspect the current | ||
1137 | state. @xref{nul-termination}. | 1158 | state. @xref{nul-termination}. |
1159 | @end deffn | ||
1138 | 1160 | ||
1139 | @kindex A, testgdbm command | 1161 | @deffn {command verb} avail |
1140 | @item A | 1162 | @deffnx {command abbrev} a |
1163 | @deffnx {command letter} A | ||
1141 | Print the @dfn{avail list}. | 1164 | Print the @dfn{avail list}. |
1142 | 1165 | @end deffn | |
1143 | @kindex B, testgdbm command | 1166 | |
1144 | @item B @var{num} | 1167 | @deffn {command verb} bucket |
1145 | Print the bucket number @var{num}. This command uses pager | 1168 | @deffnx {command abbrev} b |
1146 | (@pxref{pager}). | 1169 | @deffnx {command letter} B |
1147 | 1170 | Print the bucket number @var{num}. | |
1148 | @kindex C, testgdbm command | 1171 | @end deffn |
1149 | @item C | 1172 | |
1150 | Print the current bucket. This command uses pager (@pxref{pager}). | 1173 | @deffn {command verb} current |
1151 | 1174 | @deffnx {command abbrev} cu | |
1152 | @kindex D, testgdbm command | 1175 | @deffnx {command letter} C |
1153 | @item D | 1176 | Print the current bucket. |
1154 | Print hash directory. Uses pager (@pxref{pager}). | 1177 | @end deffn |
1155 | 1178 | ||
1156 | @kindex F, testgdbm command | 1179 | @deffn {command verb} dir |
1157 | @item F | 1180 | @deffnx {command abbrev} di |