dummy commit before egcs merge
[deliverable/binutils-gdb.git] / gdb / command.c
index bd5c1231db0414535c4785779fc4c8c5eb392a90..f3686202b18338dac6712337806f14f397d3cfd8 100644 (file)
@@ -1,5 +1,5 @@
 /* Handle lists of commands, their decoding and documentation, for GDB.
-   Copyright 1986, 1989, 1990, 1991 Free Software Foundation, Inc.
+   Copyright 1986, 1989, 1990, 1991, 1998 Free Software Foundation, Inc.
 
 This program is free software; you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
@@ -19,35 +19,39 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "gdbcmd.h"
 #include "symtab.h"
 #include "value.h"
-#include "wait.h"
 #include <ctype.h>
 #include "gdb_string.h"
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
 #endif
 
+#ifdef HAVE_WAIT_H
+# include <wait.h>
+#else
+# ifdef HAVE_SYS_WAIT_H
+#  include <sys/wait.h>
+# endif
+#endif
+
+#include "wait.h"
+
 /* Prototypes for local functions */
 
-static void
-undef_cmd_error PARAMS ((char *, char *));
+static void undef_cmd_error PARAMS ((char *, char *));
 
-static void
-show_user PARAMS ((char *, int));
+static void show_user PARAMS ((char *, int));
 
-static void
-show_user_1 PARAMS ((struct cmd_list_element *, GDB_FILE *));
+static void show_user_1 PARAMS ((struct cmd_list_element *, GDB_FILE *));
 
-static void
-make_command PARAMS ((char *, int));
+static void make_command PARAMS ((char *, int));
 
-static void
-shell_escape PARAMS ((char *, int));
+static void shell_escape PARAMS ((char *, int));
 
-static int
-parse_binary_operation PARAMS ((char *));
+static int parse_binary_operation PARAMS ((char *));
 
-static void
-print_doc_line PARAMS ((GDB_FILE *, char *));
+static void print_doc_line PARAMS ((GDB_FILE *, char *));
+
+void _initialize_command PARAMS ((void));
 
 /* Add element named NAME.
    CLASS is the top level category into which commands are broken down
@@ -281,7 +285,6 @@ add_set_enum_cmd (name, class, enumlist, var, doc, list)
 {
   struct cmd_list_element *c
     = add_set_cmd (name, class, var_enum, var, doc, list);
-
   c->enums = enumlist;
 
   return c;
@@ -1269,8 +1272,23 @@ do_setshow_command (arg, from_tty, c)
            char *match = NULL;
            char *p;
 
-           p = strchr (arg, ' ');
+           /* if no argument was supplied, print an informative error message */
+           if (arg == NULL)
+             {
+               char msg[1024];
+               strcpy (msg, "Requires an argument. Valid arguments are ");
+               for (i = 0; c->enums[i]; i++)
+                 {
+                   if (i != 0)
+                     strcat (msg, ", ");
+                   strcat (msg, c->enums[i]);
+                 }
+               strcat (msg, ".");
+               error (msg);
+             }
 
+           p = strchr (arg, ' ');
+           
            if (p)
              len = p - arg;
            else
This page took 0.040663 seconds and 4 git commands to generate.