]> git.sur5r.net Git - ngadmin/blob - cli/com_help.c
Let commands handle themselves absence of arguments
[ngadmin] / cli / com_help.c
1
2 #include "commands.h"
3
4
5 bool do_help (int argc, const char **argv UNUSED, struct ngadmin *nga UNUSED)
6 {
7         const struct TreeNode *s;
8         
9         
10         if (argc > 0) {
11                 printf("this command takes no argument\n");
12                 return false;
13         }
14         
15         printf("Available commands: \n");
16         
17         for (s = commands.sub; s->name != NULL; s++)
18                 printf("%s ", s->name);
19         putchar('\n');
20         
21         return true;
22 }
23
24