efn/main.c

13 lines
246 B
C
Raw Normal View History

2022-04-02 11:40:10 +00:00
int
main(int argc, char **argv) {
static char buf[256];
while(1) {
2022-04-02 11:40:10 +00:00
char *com = fgets(buf, sizeof(buf), stdin);
if (com != NULL) {
if (commands[com[0]] != NULL) commands[com[0]](buf);
else puts("invalid command.");
2022-04-02 11:40:10 +00:00
}
}
return 0;
}