Skip to content

Commit 45b9e3f

Browse files
committed
Add --help flag.
It doesn't help much, but every toxin needs to respond to --help. Fixes #2.
1 parent 295facf commit 45b9e3f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

minitox.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1315,7 +1315,14 @@ void repl_iterate(){
13151315
}
13161316

13171317

1318-
int main() {
1318+
int main(int argc, char **argv) {
1319+
if (argc == 2 && strcmp(argv[1], "--help") == 0) {
1320+
fputs("Usage: minitox\n", stdout);
1321+
fputs("\n", stdout);
1322+
fputs("Minitox does not take any arguments.\n", stdout);
1323+
return 0;
1324+
}
1325+
13191326
fputs("Type `/guide` to print the guide.\n", stdout);
13201327
fputs("Type `/help` to print command list.\n\n",stdout);
13211328

0 commit comments

Comments
 (0)