Some general reworking, error handling

This commit is contained in:
2024-12-03 00:04:40 +00:00
parent 623b3acc1f
commit 9bbfa7d2cd
4 changed files with 36 additions and 7 deletions

13
main.c
View File

@@ -74,14 +74,19 @@ void interpret(machine_t *cpu, node_t *ast, size_t num)
#endif
}
void usage(const char *name, FILE *fp)
{
fprintf(fp,
"Usage: %s [FILE]...\n\tExecutes FILES sequentially on the "
"same machine\n",
name);
}
int main(int argc, char *argv[])
{
if (argc == 1)
{
fprintf(
stderr,
"Usage: %s [FILE]...\nReads FILES sequentially on the same machine\n",
argv[0]);
usage(argv[0], stderr);
return 1;
}