Imported from ../bash-2.05b.tar.gz.
[platform/upstream/bash.git] / builtins / bind.def
index 40c8c9f..ddf5619 100644 (file)
@@ -1,7 +1,7 @@
 This file is bind.def, from which is created bind.c.
 It implements the builtin "bind" in Bash.
 
-Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
+Copyright (C) 1987-2002 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -26,11 +26,12 @@ $PRODUCES bind.c
 $BUILTIN bind
 $DEPENDS_ON READLINE
 $FUNCTION bind_builtin
-$SHORT_DOC bind [-lpvsPVS] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function]
-Bind a key sequence to a Readline function, or to a macro.  The
-syntax is equivalent to that found in ~/.inputrc, but must be
-passed as a single argument: bind '"\C-x\C-r": re-read-init-file'.
-Arguments we accept:
+$SHORT_DOC bind [-lpvsPVS] [-m keymap] [-f filename] [-q name] [-u name] [-r keyseq] [-x keyseq:shell-command] [keyseq:readline-function or readline-command]
+Bind a key sequence to a Readline function or a macro, or set
+a Readline variable.  The non-option argument syntax is equivalent
+to that found in ~/.inputrc, but must be passed as a single argument:
+bind '"\C-x\C-r": re-read-init-file'.
+bind accepts the following options:
   -m  keymap         Use `keymap' as the keymap for the duration of this
                      command.  Acceptable keymap names are emacs,
                      emacs-standard, emacs-meta, emacs-ctlx, vi, vi-move,
@@ -40,8 +41,8 @@ Arguments we accept:
   -p                 List functions and bindings in a form that can be
                      reused as input.
   -r  keyseq         Remove the binding for KEYSEQ.
-  -x  keyseq:shell-command     Cause SHELL-COMMAND to be executed when KEYSEQ
-                               is entered.
+  -x  keyseq:shell-command     Cause SHELL-COMMAND to be executed when
+                               KEYSEQ is entered.
   -f  filename       Read key bindings from FILENAME.
   -q  function-name  Query about which keys invoke the named function.
   -u  function-name  Unbind all keys which are bound to the named function.
@@ -49,8 +50,8 @@ Arguments we accept:
   -v                 List variable names and values in a form that can
                      be reused as input.
   -S                 List key sequences that invoke macros and their values
-  -s                 List key sequences that invoke macros and their values in
-                     a form that can be reused as input.
+  -s                 List key sequences that invoke macros and their values
+                     in a form that can be reused as input.
 $END
 
 #if defined (READLINE)
@@ -227,7 +228,7 @@ bind_builtin (list)
     {
       if (rl_read_init_file (initfile) != 0)
        {
-         builtin_error ("cannot read %s: %s", initfile, strerror (errno));
+         builtin_error ("%s: cannot read: %s", initfile, strerror (errno));
          BIND_RETURN (EXECUTION_FAILURE);
        }
     }
@@ -242,7 +243,7 @@ bind_builtin (list)
     {
       if (rl_set_key (remove_seq, (rl_command_func_t *)NULL, rl_get_keymap ()) != 0)
        {
-         builtin_error ("cannot unbind %s", remove_seq);
+         builtin_error ("`%s': cannot unbind", remove_seq);
          BIND_RETURN (EXECUTION_FAILURE);
        }
     }
@@ -277,7 +278,7 @@ query_bindings (name)
   function = rl_named_function (name);
   if (function == 0)
     {
-      builtin_error ("unknown function name `%s'", name);
+      builtin_error ("`%s': unknown function name", name);
       return EXECUTION_FAILURE;
     }
 
@@ -294,7 +295,7 @@ query_bindings (name)
     printf ("\"%s\"%s", keyseqs[j], keyseqs[j + 1] ? ", " : ".\n");
   if (keyseqs[j])
     printf ("...\n");
-  free_array (keyseqs);
+  strvec_dispose (keyseqs);
   return EXECUTION_SUCCESS;
 }
 
@@ -307,7 +308,7 @@ unbind_command (name)
   function = rl_named_function (name);
   if (function == 0)
     {
-      builtin_error ("unknown function name `%s'", name);
+      builtin_error ("`%s': unknown function name", name);
       return EXECUTION_FAILURE;
     }