return 1;
}
- if(!check_id(argv[2])) {
+ if(!check_id(argv[1])) {
fprintf(stderr, "Invalid name for node.\n");
return 1;
}
return 1;
}
- if(!check_id(argv[2])) {
+ if(!check_id(argv[1])) {
fprintf(stderr, "Invalid name for node.\n");
return 1;
}
}
#else
if(tty)
- fputs(stdout, prompt);
+ fputs(prompt, stdout);
line = fgets(buf, sizeof buf, stdin);
#endif
if(nargc == argc)
continue;
+ if(!strcasecmp(nargv[argc], "exit") || !strcasecmp(nargv[argc], "quit"))
+ return result;
+
bool found = false;
for(int i = 0; commands[i].command; i++) {
}
#ifdef HAVE_READLINE
- if(found)
+ if(tty && found)
add_history(copy);
#endif