aboutsummaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2011-08-24 20:30:22 +0000
committerSergey Poznyakoff <gray@gnu.org.ua>2011-08-24 20:30:22 +0000
commit7ea0c0578a59abc086496024dbf6cc65b6e94e38 (patch)
treee45c89740ba84edbf809efb8aae5fc2447eee580 /doc
parent51c2a16f2d3658672421892e2c3405c6ed74c490 (diff)
downloadgdbm-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.texinfo204
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
1008com -> _ 1008testgdbm> _
1009@end example 1009@end example
1010 1010
1011The utility finishes when it reads the @samp{q} command (see below) or 1011The utility finishes when it reads the @samp{quit} command (see below) or
1012it detects end-of-file on its standard input, whichever occurs first. 1012detects end-of-file on its standard input, whichever occurs first.
1013 1013
1014A @command{testgdbm} command consists of a @dfn{command letter}, 1014A @command{testgdbm} command consists of a @dfn{command verb},
1015optionally followed by one or two @dfn{arguments}, separated by any 1015optionally followed by one or two @dfn{arguments}, separated by any
1016amount of white space. An argument is any sequence of non-whitespace 1016amount of white space. A command verb can be entered either in full
1017characters. Notice, that currently there is no way to enter arguments 1017or in an abbreviated form, as long as that abbreviation does not match
1018containing white space. This limitation will be removed in future 1018any other verb. For example, @samp{co} can be used instead of
1019releases. 1019@samp{count} and @samp{ca} instead of @samp{cache}. Furthermore,
1020many command verbs also have single-letter forms, called @dfn{command
1021letters}.
1022
1023An argument is any sequence of non-whitespace characters. Notice,
1024that currently there is no way to enter arguments containing white
1025space. This limitation will be removed in future releases.
1020 1026
1021Each command letter takes at most two @dfn{formal parameters}, which can be 1027Each command letter takes at most two @dfn{formal parameters}, which can be
1022optional or mandatory. If the number of actual arguments is less than the 1028optional 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
1027example below: 1033example below:
1028 1034
1029@example 1035@example
1030com -> @kbd{s} 1036testgdbm> @kbd{s}
1031key -> @kbd{three} 1037key> @kbd{three}
1032data -> @kbd{3} 1038data> @kbd{3}
1033@end example 1039@end example
1034 1040
1035However, such prompting is possible only in interactive mode. In 1041However, 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
1057The following table summarizes all available commands: 1063The 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
1062Print the number of entries in the database. 1068Print 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}
1066Delete entry with a given @var{key} 1074Delete 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]
1071Export the database to the flat file @var{file-name}. @xref{Flat files}, 1080Export the database to the flat file @var{file-name}. @xref{Flat files},
1072for a description of the flat file format and its purposes. This 1081for a description of the flat file format and its purposes. This
1073command will not overwrite an existing file, unless the word 1082command 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
1076See also @ref{gdbmexport}. 1085See 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}
1080Fetch and display a record with the given @var{key}. 1091Fetch 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]
1085Import data from a flat dump file @var{file-name} 1097Import 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
1087as the second argument, any records with the same keys as the already 1099as the second argument, any records with the same keys as the already
1088existing ones will replace them. 1100existing 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
1092List the contents of the database (@pxref{pager}). 1105List 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}]
1098Sequential access: fetch and display a next record. If @var{key} is 1110Sequential access: fetch and display a next record. If @var{key} is
1099given, a record following one with this key will be fetched. 1111given, a record following one with this key will be fetched.
1100Otherwise, the key supplied by the latest @code{1}, @code{2} or 1112Otherwise, 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
1103The second form, @code{2} is a synonym for @code{n} without arguments. 1115See also @code{first}, below.
1104
1105See 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
1111Close the database and quit the utility. 1122Close 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}
1115Store the @var{data} with @var{key} in the database. If @var{key} 1128Store the @var{data} with @var{key} in the database. If @var{key}
1116already exists, its data will be replaced. 1129already 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
1120Fetch and display the first record in the database. Subsequent 1135Fetch and display the first record in the database. Subsequent
1121records can be fetched using @code{n} (or @code{2}) command (see above). 1136records 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]
1126Read entries from @var{file} and store them in the database. If the 1143Read entries from @var{file} and store them in the database. If the
1127word @samp{replace} is given as the second argument, any existing 1144word @samp{replace} is given as the second argument, any existing
1128records with matching keys will be replaced. 1145records 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
1132Reorganize the database (@pxref{Reorganization}). 1151Reorganize 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
1136Toggle key nul-termination. Use @code{S} to inspect the current 1156@deffnx {command letter} z
1157Toggle key nul-termination. Use @code{status} to inspect the current
1137state. @xref{nul-termination}. 1158state. @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
1141Print the @dfn{avail list}. 1164Print the @dfn{avail list}.
1142 1165@end deffn
1143@kindex B, testgdbm command 1166
1144@item B @var{num} 1167@deffn {command verb} bucket
1145Print the bucket number @var{num}. This command uses pager 1168@deffnx {command abbrev} b
1146(@pxref{pager}). 1169@deffnx {command letter} B
1147 1170Print the bucket number @var{num}.
1148@kindex C, testgdbm command 1171@end deffn
1149@item C 1172
1150Print 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 1176Print the current bucket.
1154Print 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