Imported from ../bash-3.1.tar.gz.
[platform/upstream/bash.git] / builtins / set.def
index 10aaf5f..3bb3270 100644 (file)
@@ -1,7 +1,7 @@
 This file is set.def, from which is created set.c.
 It implements the "set" and "unset" builtins in Bash.
 
-Copyright (C) 1987-2002 Free Software Foundation, Inc.
+Copyright (C) 1987-2004 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -33,6 +33,7 @@ $PRODUCES set.c
 #include <stdio.h>
 
 #include "../bashansi.h"
+#include "../bashintl.h"
 
 #include "../shell.h"
 #include "../flags.h"
@@ -77,6 +78,8 @@ $SHORT_DOC set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
             emacs        use an emacs-style line editing interface
 #endif /* READLINE */
             errexit      same as -e
+            errtrace     same as -E
+            functrace    same as -T
             hashall      same as -h
 #if defined (BANG_HISTORY)
             histexpand   same as -H
@@ -97,6 +100,9 @@ $SHORT_DOC set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
             nounset      same as -u
             onecmd       same as -t
             physical     same as -P
+            pipefail     the return value of a pipeline is the status of
+                         the last command to exit with a non-zero status,
+                         or zero if no command exited with a non-zero status
             posix        change the behavior of bash where the default
                          operation differs from the 1003.2 standard to
                          match the standard
@@ -119,12 +125,16 @@ $SHORT_DOC set [--abefhkmnptuvxBCHP] [-o option] [arg ...]
 #endif /* BRACE_EXPANSION */
     -C  If set, disallow existing regular files to be overwritten
         by redirection of output.
+    -E  If set, the ERR trap is inherited by shell functions.
 #if defined (BANG_HISTORY)
     -H  Enable ! style history substitution.  This flag is on
-        by default.
+        by default when the shell is interactive.
 #endif /* BANG_HISTORY */
     -P  If set, do not follow symbolic links when executing commands
         such as cd which change the current directory.
+    -T  If set, the DEBUG trap is inherited by shell functions.
+    -   Assign any remaining arguments to the positional parameters.
+        The -x and -v options are turned off.
 
 Using + rather than - causes these flags to be turned off.  The
 flags can also be used upon invocation of the shell.  The current
@@ -172,6 +182,8 @@ struct {
   { "emacs",     '\0', (int *)NULL, set_edit_mode, get_edit_mode },
 #endif
   { "errexit",   'e', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL  },
+  { "errtrace",          'E', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL  },
+  { "functrace",  'T', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL  },
   { "hashall",    'h', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL  },
 #if defined (BANG_HISTORY)
   { "histexpand", 'H', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL  },
@@ -195,6 +207,7 @@ struct {
   { "nounset",   'u', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL  },
   { "onecmd",    't', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL },
   { "physical",   'P', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL  },
+  { "pipefail",  '\0', &pipefail_opt, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL  },
   { "posix",     '\0', &posixly_correct, set_posix_mode, (setopt_get_func_t *)NULL },
   { "privileged", 'p', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL  },
   { "verbose",   'v', (int *)NULL, (setopt_set_func_t *)NULL, (setopt_get_func_t *)NULL  },
@@ -300,7 +313,7 @@ set_ignoreeof (on_or_off, option_name)
   ignoreeof = on_or_off == FLAG_ON;
   unbind_variable ("ignoreeof");
   if (ignoreeof)
-    bind_variable ("IGNOREEOF", "10"); 
+    bind_variable ("IGNOREEOF", "10", 0); 
   else
     unbind_variable ("IGNOREEOF");
   sv_ignoreeof ("IGNOREEOF");
@@ -316,7 +329,7 @@ set_posix_mode (on_or_off, option_name)
   if (posixly_correct == 0)
     unbind_variable ("POSIXLY_CORRECT");
   else
-    bind_variable ("POSIXLY_CORRECT", "y");
+    bind_variable ("POSIXLY_CORRECT", "y", 0);
   sv_strict_posix ("POSIXLY_CORRECT");
   return (0);
 }
@@ -492,7 +505,7 @@ set_shellopts ()
   else
     exported = 0;
 
-  v = bind_variable ("SHELLOPTS", value);
+  v = bind_variable ("SHELLOPTS", value, 0);
 
   /* Turn the read-only attribute back on, and turn off the export attribute
      if it was set implicitly by mark_modified_vars and SHELLOPTS was not
@@ -729,7 +742,7 @@ unset_builtin (list)
 
   if (unset_function && unset_variable)
     {
-      builtin_error ("cannot simultaneously unset a function and a variable");
+      builtin_error (_("cannot simultaneously unset a function and a variable"));
       return (EXECUTION_FAILURE);
     }
 
@@ -766,14 +779,14 @@ unset_builtin (list)
 
       if (var && !unset_function && non_unsettable_p (var))
        {
-         builtin_error ("%s: cannot unset", name);
+         builtin_error (_("%s: cannot unset"), name);
          NEXT_VARIABLE ();
        }
 
       /* Posix.2 says that unsetting readonly variables is an error. */
       if (var && readonly_p (var))
        {
-         builtin_error ("%s: cannot unset: readonly %s",
+         builtin_error (_("%s: cannot unset: readonly %s"),
                         name, unset_function ? "function" : "variable");
          NEXT_VARIABLE ();
        }
@@ -784,7 +797,7 @@ unset_builtin (list)
        {
          if (array_p (var) == 0)
            {
-             builtin_error ("%s: not an array variable", name);
+             builtin_error (_("%s: not an array variable"), name);
              NEXT_VARIABLE ();
            }
          else