]> git.sur5r.net Git - ngadmin/blob - cli/com_scan.c
Let commands handle themselves absence of arguments
[ngadmin] / cli / com_scan.c
1
2 #include "commands.h"
3
4
5 bool do_scan (int argc, const char **argv UNUSED, struct ngadmin *nga)
6 {
7         int i;
8         const struct swi_attr *sa;
9         
10         
11         if (argc > 0) {
12                 printf("this command takes no argument\n");
13                 return false;
14         }
15         
16         i = ngadmin_scan(nga);
17         if (i < 0) {
18                 printErrCode(i);
19                 return false;
20         }
21         
22         sa = ngadmin_getSwitchTab(nga, &i);
23         displaySwitchTab(sa, i);
24         
25         
26         return true;
27 }
28
29