From 5e34909a12b15a8edab45c9f8f0915e2abb23b76 Mon Sep 17 00:00:00 2001 From: Damien George Date: Sat, 8 Mar 2014 19:04:47 +0000 Subject: unix: Make usage info reflect actual usage of -X option. --- unix/main.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'unix/main.c') diff --git a/unix/main.c b/unix/main.c index 481b815810..6a7b44ff84 100644 --- a/unix/main.c +++ b/unix/main.c @@ -209,7 +209,12 @@ mp_obj_t test_obj_new(int value) { } int usage(void) { - printf("usage: py [-c ] [-X ] []\n"); + printf( +"usage: py [-X ] [-c ] []\n" +"\n" +"Implementation specific options:\n" +" heapsize= -- set the heap size for the GC\n" +); return 1; } @@ -242,11 +247,14 @@ void pre_process_options(int argc, char **argv) { 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++; } } -- cgit v1.2.3