File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -209,7 +209,12 @@ mp_obj_t test_obj_new(int value) {
209209}
210210
211211int usage (void ) {
212- printf ("usage: py [-c <command>] [-X <heap size>] [<filename>]\n" );
212+ printf (
213+ "usage: py [-X <opt>] [-c <command>] [<filename>]\n"
214+ "\n"
215+ "Implementation specific options:\n"
216+ " heapsize=<n> -- set the heap size for the GC\n"
217+ );
213218 return 1 ;
214219}
215220
@@ -242,11 +247,14 @@ void pre_process_options(int argc, char **argv) {
242247 if (a + 1 >= argc ) {
243248 exit (usage ());
244249 }
250+ if (0 ) {
245251#if MICROPY_ENABLE_GC
246- if (strncmp (argv [a + 1 ], "heapsize=" , sizeof ("heapsize=" ) - 1 ) == 0 ) {
252+ } else if (strncmp (argv [a + 1 ], "heapsize=" , sizeof ("heapsize=" ) - 1 ) == 0 ) {
247253 heap_size = strtol (argv [a + 1 ] + sizeof ("heapsize=" ) - 1 , NULL , 0 );
248- }
249254#endif
255+ } else {
256+ exit (usage ());
257+ }
250258 a ++ ;
251259 }
252260 }
You can’t perform that action at this time.
0 commit comments