]> git.sur5r.net Git - ngadmin/blobdiff - cli/com_help.c
Let commands handle themselves absence of arguments
[ngadmin] / cli / com_help.c
index e1bad0e5289f8f6e71097ee46cdcba5df3e51510..a857cc15b61bfbd4f269677305f1da67d3aff992 100644 (file)
@@ -2,13 +2,19 @@
 #include "commands.h"
 
 
-bool do_help (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga UNUSED)
+bool do_help (int argc, const char **argv UNUSED, struct ngadmin *nga UNUSED)
 {
        const struct TreeNode *s;
        
+       
+       if (argc > 0) {
+               printf("this command takes no argument\n");
+               return false;
+       }
+       
        printf("Available commands: \n");
        
-       for (s = coms.sub; s->name != NULL; s++)
+       for (s = commands.sub; s->name != NULL; s++)
                printf("%s ", s->name);
        putchar('\n');