X-Git-Url: https://git.sur5r.net/?p=ngadmin;a=blobdiff_plain;f=cli%2Fcom_help.c;h=a857cc15b61bfbd4f269677305f1da67d3aff992;hp=e1bad0e5289f8f6e71097ee46cdcba5df3e51510;hb=ba1e16863bdedc5f52b077932aa7301ed14a0f06;hpb=8d96dbb186138459117b82268407c0fb45339e8f diff --git a/cli/com_help.c b/cli/com_help.c index e1bad0e..a857cc1 100644 --- a/cli/com_help.c +++ b/cli/com_help.c @@ -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');