Imported from ../bash-3.2.48.tar.gz.
[platform/upstream/bash.git] / builtins / shopt.def
index ae15330..db46c31 100644 (file)
@@ -1,7 +1,7 @@
 This file is shopt.def, from which is created shopt.c.
 It implements the Bash `shopt' builtin.
 
-Copyright (C) 1994-2002 Free Software Foundation, Inc.
+Copyright (C) 1994-2005 Free Software Foundation, Inc.
 
 This file is part of GNU Bash, the Bourne Again SHell.
 
@@ -45,6 +45,8 @@ $END
 
 #include <stdio.h>
 
+#include "../bashintl.h"
+
 #include "../shell.h"
 #include "../flags.h"
 #include "common.h"
@@ -55,15 +57,17 @@ $END
 
 #define OPTFMT         "%-15s\t%s\n"
 
-extern int allow_null_glob_expansion, glob_dot_filenames;
+extern int allow_null_glob_expansion, fail_glob_expansion, glob_dot_filenames;
 extern int cdable_vars, mail_warning, source_uses_path;
 extern int no_exit_on_failed_exec, print_shift_error;
 extern int check_hashed_filenames, promptvars;
 extern int cdspelling, expand_aliases;
+extern int extended_quote;
 extern int check_window_size;
-extern int glob_ignore_case;
+extern int glob_ignore_case, match_ignore_case;
 extern int hup_on_exit;
 extern int xpg_echo;
+extern int gnu_error_format;
 
 #if defined (EXTENDED_GLOB)
 extern int extended_glob;
@@ -77,6 +81,7 @@ extern int force_append_history;
 #if defined (READLINE)
 extern int hist_verify, history_reediting, perform_hostname_completion;
 extern int no_empty_command_completion;
+extern int force_fignore;
 extern int enable_hostname_completion __P((int));
 #endif
 
@@ -88,15 +93,22 @@ extern int prog_completion_enabled;
 extern char *shell_name;
 #endif
 
+#if defined (DEBUGGER)
+extern int debugging_mode;
+#endif
+
 static void shopt_error __P((char *));
 
-static int set_interactive_comments __P((int));
+static int set_shellopts_after_change __P((int));
+
+static int set_compatibility_level __P((int));
 
 #if defined (RESTRICTED_SHELL)
 static int set_restricted_shell __P((int));
 #endif
 
 static int shopt_login_shell;
+static int shopt_compat31;
 
 typedef int shopt_set_func_t __P((int));
 
@@ -112,24 +124,32 @@ static struct {
 #if defined (HISTORY)
   { "cmdhist", &command_oriented_history, (shopt_set_func_t *)NULL },
 #endif
+  { "compat31", &shopt_compat31, set_compatibility_level },
   { "dotglob", &glob_dot_filenames, (shopt_set_func_t *)NULL },
   { "execfail", &no_exit_on_failed_exec, (shopt_set_func_t *)NULL },
   { "expand_aliases", &expand_aliases, (shopt_set_func_t *)NULL },
+#if defined (DEBUGGER)
+  { "extdebug", &debugging_mode, (shopt_set_func_t *)NULL },
+#endif
 #if defined (EXTENDED_GLOB)
   { "extglob", &extended_glob, (shopt_set_func_t *)NULL },
 #endif
+  { "extquote", &extended_quote, (shopt_set_func_t *)NULL },
+  { "failglob", &fail_glob_expansion, (shopt_set_func_t *)NULL },
 #if defined (READLINE)
-  { "histreedit", &history_reediting, (shopt_set_func_t *)NULL },
+  { "force_fignore", &force_fignore, (shopt_set_func_t *)NULL },
 #endif
+  { "gnu_errfmt", &gnu_error_format, (shopt_set_func_t *)NULL },
 #if defined (HISTORY)
   { "histappend", &force_append_history, (shopt_set_func_t *)NULL },
 #endif
 #if defined (READLINE)
+  { "histreedit", &history_reediting, (shopt_set_func_t *)NULL },
   { "histverify", &hist_verify, (shopt_set_func_t *)NULL },
   { "hostcomplete", &perform_hostname_completion, enable_hostname_completion },
 #endif
   { "huponexit", &hup_on_exit, (shopt_set_func_t *)NULL },
-  { "interactive_comments", &interactive_comments, set_interactive_comments },
+  { "interactive_comments", &interactive_comments, set_shellopts_after_change },
 #if defined (HISTORY)
   { "lithist", &literal_history, (shopt_set_func_t *)NULL },
 #endif
@@ -139,6 +159,7 @@ static struct {
   { "no_empty_cmd_completion", &no_empty_command_completion, (shopt_set_func_t *)NULL },
 #endif
   { "nocaseglob", &glob_ignore_case, (shopt_set_func_t *)NULL },
+  { "nocasematch", &match_ignore_case, (shopt_set_func_t *)NULL },
   { "nullglob",        &allow_null_glob_expansion, (shopt_set_func_t *)NULL },
 #if defined (PROGRAMMABLE_COMPLETION)
   { "progcomp", &prog_completion_enabled, (shopt_set_func_t *)NULL },
@@ -207,7 +228,7 @@ shopt_builtin (list)
 
   if ((flags & (SFLAG|UFLAG)) == (SFLAG|UFLAG))
     {
-      builtin_error ("cannot set and unset shell options simultaneously");
+      builtin_error (_("cannot set and unset shell options simultaneously"));
       return (EXECUTION_FAILURE);
     }
 
@@ -272,7 +293,7 @@ static void
 shopt_error (s)
      char *s;
 {
-  builtin_error ("%s: invalid shell option name", s);
+  builtin_error (_("%s: invalid shell option name"), s);
 }
 
 static int
@@ -435,13 +456,25 @@ set_shopt_o_options (mode, list, quiet)
 /* If we set or unset interactive_comments with shopt, make sure the
    change is reflected in $SHELLOPTS. */
 static int
-set_interactive_comments (mode)
+set_shellopts_after_change (mode)
      int mode;
 {
   set_shellopts ();
   return (0);
 }
 
+static int
+set_compatibility_level (mode)
+     int mode;
+{
+  /* Need to change logic here as we add more compatibility levels */
+  if (shopt_compat31)
+    shell_compatibility_level = 31;
+  else
+    shell_compatibility_level = 32;
+  return 0;
+}
+
 #if defined (RESTRICTED_SHELL)
 /* Don't allow the value of restricted_shell to be modified. */