]> git.sur5r.net Git - ngadmin/blobdiff - cli/com_tree.c
Let commands handle themselves absence of arguments
[ngadmin] / cli / com_tree.c
index cad5d5725d2bb96bb015be06620db2112580186f..4b4384b3e56b96b242e5b83f2a52b47056edacc4 100644 (file)
@@ -20,9 +20,14 @@ static void display_node (const struct TreeNode *tn, int depth)
 }
 
 
-bool do_tree (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga UNUSED)
+bool do_tree (int argc, const char **argv UNUSED, struct ngadmin *nga UNUSED)
 {
-       display_node(&coms, 0);
+       if (argc > 0) {
+               printf("this command takes no argument\n");
+               return false;
+       }
+       
+       display_node(&commands, 0);
        
        return true;
 }