X-Git-Url: https://git.sur5r.net/?p=ngadmin;a=blobdiff_plain;f=cli%2Fcom_ports.c;h=866a84b49a5413ecabafd77e8bc723ac64dd730d;hp=7c3fbb22b6ca6ec57764f311ef935bfb4bad760b;hb=ba1e16863bdedc5f52b077932aa7301ed14a0f06;hpb=8d96dbb186138459117b82268407c0fb45339e8f diff --git a/cli/com_ports.c b/cli/com_ports.c index 7c3fbb2..866a84b 100644 --- a/cli/com_ports.c +++ b/cli/com_ports.c @@ -2,7 +2,7 @@ #include "commands.h" -bool do_ports_state (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga) +bool do_ports_state (int argc, const char **argv UNUSED, struct ngadmin *nga) { int i; const struct swi_attr *sa; @@ -10,6 +10,12 @@ bool do_ports_state (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga bool ret = true; + if (argc > 0) { + printf("this command takes no argument\n"); + ret = false; + goto end; + } + sa = ngadmin_getCurrentSwitch(nga); if (sa == NULL) { printf("must be logged\n"); @@ -59,10 +65,16 @@ end: } -bool do_ports_statistics_reset (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga) +bool do_ports_statistics_reset (int argc, const char **argv UNUSED, struct ngadmin *nga) { int i; + + if (argc > 0) { + printf("this command takes no argument\n"); + return false; + } + if (ngadmin_getCurrentSwitch(nga) == NULL) { printf("must be logged\n"); return false; @@ -75,7 +87,7 @@ bool do_ports_statistics_reset (int nb UNUSED, const char **com UNUSED, struct n } -bool do_ports_statistics_show (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga) +bool do_ports_statistics_show (int argc, const char **argv UNUSED, struct ngadmin *nga) { int i; const struct swi_attr *sa; @@ -83,6 +95,12 @@ bool do_ports_statistics_show (int nb UNUSED, const char **com UNUSED, struct ng struct port_stats *ps = NULL; + if (argc > 0) { + printf("this command takes no argument\n"); + ret = false; + goto end; + } + sa = ngadmin_getCurrentSwitch(nga); if (sa == NULL) { printf("must be logged\n");