From dae93e6ab7ab75734bd1abd8abbd107579abbf5d Mon Sep 17 00:00:00 2001 From: Sergey Poznyakoff Date: Mon, 25 Jul 2016 16:35:25 +0300 Subject: Improve the "next" shortcut. * src/gdbmtool.c (open_handler): Close the previously opened database. (close_handler): Free the file name. (print_dir_handler): Print the number of buckets. (command_repeat_type): New enum. (command) : Change type to enum command_repeat_type. (command_tab): Update accordingly. Mark "next" with REPEAT_NOARG. (run_last_command): Handle REPEAT_NOARG separately. * NEWS: Document the shortcut. * doc/gdbm.texi: Likewise. * src/debug.c (datbuf_format): Don't represent bytes after the end of datum as zeros. (gdbm_debug_datum): Print datum size. --- doc/gdbm.texi | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'doc') diff --git a/doc/gdbm.texi b/doc/gdbm.texi index 7f93046..4eb8793 100644 --- a/doc/gdbm.texi +++ b/doc/gdbm.texi @@ -1923,8 +1923,8 @@ existing @acronym{GDBM} database or to create a new one. @flindex junk.gdbm 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 by supplying the name of the database to use as -an argument to the program, e.g.: +change this default by supplying the name of the database as +argument to the program, e.g.: @example $ gdbmtool file.db @@ -2007,7 +2007,7 @@ command line options. After successful startup, @command{gdbmtool} starts a loop, in which it reads commands from the standard input, executes them and prints -the results on the standard output. If the standard input is attached +results on the standard output. If the standard input is attached to a console, @command{gdbmtool} runs in interactive mode, which is indicated by its @dfn{prompt}: @@ -2384,6 +2384,11 @@ List the contents of the database. Sequential access: fetch and display the next record. If the @var{key} is given, the record following the one with this key will be fetched. +Issuing several @code{next} commands in row is rather common. A +shortcut is provided to facilitate such use: if the last entered +command was @command{next}, hitting the @kbd{Enter} key repeats it +without arguments. + See also @code{first}, above. @xref{Sequential}, for more information on sequential access. -- cgit v1.2.1