Cleanup bfd_close() cleanups.
[deliverable/binutils-gdb.git] / gdb / command.c
index 737ac77122294d3b73e057ab4a332f430c6c9c0e..d753d77fef37307dd4b5a9710054d159b8ef936c 100644 (file)
@@ -57,6 +57,8 @@ static struct cmd_list_element *find_cmd PARAMS ((char *command,
 static void apropos_cmd_helper (struct ui_file *, struct cmd_list_element *, 
                                struct re_pattern_buffer *, char *);
 
+static void help_all (struct ui_file *stream);
+
 void apropos_command (char *, int);
 
 void _initialize_command PARAMS ((void));
@@ -510,6 +512,12 @@ help_cmd (command, stream)
       return;
     }
 
+  if (strcmp (command, "all") == 0)
+    {
+      help_all (stream);
+      return;
+    }
+
   c = lookup_cmd (&command, cmdlist, "", 0, 0);
 
   if (c == 0)
@@ -602,6 +610,26 @@ Command name abbreviations are allowed if unambiguous.\n",
                    cmdtype1, cmdtype2);
 }
 
+static void
+help_all (struct ui_file *stream)
+{
+  struct cmd_list_element *c;
+  extern struct cmd_list_element *cmdlist;
+
+  for (c = cmdlist; c; c = c->next)
+    {
+      if (c->abbrev_flag)
+        continue;
+      /* If this is a prefix command, print it's subcommands */
+      if (c->prefixlist)
+        help_cmd_list (*c->prefixlist, all_commands, c->prefixname, 0, stream);
+    
+      /* If this is a class name, print all of the commands in the class */
+      else if (c->function.cfunc == NULL)
+        help_cmd_list (cmdlist, c->class, "", 0, stream);
+    }
+}
+
 /* Print only the first line of STR on STREAM.  */
 static void
 print_doc_line (stream, str)
@@ -1695,7 +1723,7 @@ do_setshow_command (arg, from_tty, c)
       int quote;
 
       stb = ui_out_stream_new (uiout);
-      old_chain = make_cleanup ((make_cleanup_func) ui_out_stream_delete, stb);
+      old_chain = make_cleanup_ui_out_stream_delete (stb);
 #endif /* UI_OUT */
 
       /* Print doc minus "show" at start.  */
This page took 0.025136 seconds and 4 git commands to generate.