#include "commands.h"
-bool do_name_show (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga)
+bool do_name_show (int argc, const char **argv UNUSED, struct ngadmin *nga)
{
const struct swi_attr *sa;
+ if (argc > 0) {
+ printf("this command takes no argument\n");
+ return false;
+ }
+
sa = ngadmin_getCurrentSwitch(nga);
if (sa == NULL) {
printf("must be logged\n");
}
-bool do_name_set (int nb, const char **com, struct ngadmin *nga)
+bool do_name_set (int argc, const char **argv, struct ngadmin *nga)
{
int i;
const struct swi_attr *sa;
- if (nb != 1) {
- printf("Usage: name set <value>\n");
+ if (argc != 1) {
+ printf("usage: name set <value>\n");
return false;
}
return false;
}
- i = ngadmin_setName(nga, com[0]);
+ i = ngadmin_setName(nga, argv[0]);
printErrCode(i);
}
-bool do_name_clear (int nb UNUSED, const char **com UNUSED, struct ngadmin *nga)
+bool do_name_clear (int argc, const char **argv UNUSED, struct ngadmin *nga)
{
int i;
const struct swi_attr *sa;
+ if (argc > 0) {
+ printf("this command takes no argument\n");
+ return false;
+ }
+
sa = ngadmin_getCurrentSwitch(nga);
if (sa == NULL) {
printf("must be logged\n");