]> git.tuebingen.mpg.de Git - adu.git/blobdiff - interactive.c
Add the latex and html directories to .gitignore.
[adu.git] / interactive.c
index 62ff5edb774ded49b643e14c4a94f72336f4115c..b3254157d6785403573252876624c026ed912ed4 100644 (file)
@@ -7,9 +7,18 @@
 #include "error.h"
 #include "cmdline.h"
 
+/**
+ * Describes one valid command for interactive mode.
+ *
+ * When invoked in interactive mode, adu reads commands from stdin. There's a
+ * static array of all such commands.
+ */
 struct interactive_command {
+       /** The name of the command. */
        const char *name;
+       /** Pointer to The function that is being executed. */
        int (*handler)(char *);
+       /** Help text. */
        const char *desc;
 };
 
@@ -65,7 +74,9 @@ static int icom_help(__a_unused char *line)
 
 void print_interactive_help(void)
 {
-       icom_help(NULL);
+       struct interactive_command *c;
+       FOR_EACH_COMMAND(c)
+               fprintf(stdout, "\t%s\t%s\n", c->name, c->desc);
 }
 
 static int icom_reset(__a_unused char *line)