]> git.sur5r.net Git - ngadmin/blob - cli/com_tree.c
Cli: refactor, change coding style
[ngadmin] / cli / com_tree.c
1
2 #include "commands.h"
3
4
5 static void display_node (const struct TreeNode *tn, int depth)
6 {
7         int i;
8         const struct TreeNode *s;
9         
10         
11         for (i = 0; i < depth; i++)
12                 putchar('\t');
13         puts(tn->name);
14         
15         if (tn->sub == NULL)
16                 return;
17         
18         for (s = tn->sub; s->name != NULL; s++)
19                 display_node(s, depth + 1);
20 }
21
22
23 bool do_tree (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga UNUSED)
24 {
25         display_node(&coms, 0);
26         
27         return true;
28 }
29
30