unix: Make usage info reflect actual usage of -X option.
diff --git a/unix/main.c b/unix/main.c
index 481b815..6a7b44f 100644
--- a/unix/main.c
+++ b/unix/main.c
@@ -209,7 +209,12 @@
}
int usage(void) {
- printf("usage: py [-c <command>] [-X <heap size>] [<filename>]\n");
+ printf(
+"usage: py [-X <opt>] [-c <command>] [<filename>]\n"
+"\n"
+"Implementation specific options:\n"
+" heapsize=<n> -- set the heap size for the GC\n"
+);
return 1;
}
@@ -242,11 +247,14 @@
if (a + 1 >= argc) {
exit(usage());
}
+ if (0) {
#if MICROPY_ENABLE_GC
- if (strncmp(argv[a + 1], "heapsize=", sizeof("heapsize=") - 1) == 0) {
+ } else if (strncmp(argv[a + 1], "heapsize=", sizeof("heapsize=") - 1) == 0) {
heap_size = strtol(argv[a + 1] + sizeof("heapsize=") - 1, NULL, 0);
- }
#endif
+ } else {
+ exit(usage());
+ }
a++;
}
}