| while (1) { |
while (1) { |
| int option_index=0; |
int option_index=0; |
| static struct option opts[] = { |
static struct option opts[] = { |
| |
{"appl-image", required_argument, NULL, 'a'}, |
| {"image-file", required_argument, NULL, 'i'}, |
{"image-file", required_argument, NULL, 'i'}, |
| {"dictionary-size", required_argument, NULL, 'm'}, |
{"dictionary-size", required_argument, NULL, 'm'}, |
| {"data-stack-size", required_argument, NULL, 'd'}, |
{"data-stack-size", required_argument, NULL, 'd'}, |
| |
|
| c = getopt_long(argc, argv, "+i:m:d:r:f:l:p:vh", opts, &option_index); |
c = getopt_long(argc, argv, "+i:m:d:r:f:l:p:vh", opts, &option_index); |
| |
|
| if (c==EOF) |
|
| break; |
|
| if (c=='?') { |
|
| optind--; |
|
| break; |
|
| } |
|
| switch (c) { |
switch (c) { |
| |
case EOF: return; |
| |
case '?': optind--; return; |
| |
case 'a': *imagename = optarg; return; |
| case 'i': *imagename = optarg; break; |
case 'i': *imagename = optarg; break; |
| case 'm': dictsize = convsize(optarg,sizeof(Cell)); break; |
case 'm': dictsize = convsize(optarg,sizeof(Cell)); break; |
| case 'd': dsize = convsize(optarg,sizeof(Cell)); break; |
case 'd': dsize = convsize(optarg,sizeof(Cell)); break; |
| case 'p': *path = optarg; break; |
case 'p': *path = optarg; break; |
| case 'v': fprintf(stderr, "gforth %s\n", VERSION); exit(0); |
case 'v': fprintf(stderr, "gforth %s\n", VERSION); exit(0); |
| case 'h': |
case 'h': |
| fprintf(stderr, "Usage: %s [engine options] [image arguments]\n\ |
fprintf(stderr, "Usage: %s [engine options] ['--'] [image arguments]\n\ |
| Engine Options:\n\ |
Engine Options:\n\ |
| |
--appl-image FILE equivalent to '--image-file=FILE --'\n\ |
| --clear-dictionary Initialize the dictionary with 0 bytes\n\ |
--clear-dictionary Initialize the dictionary with 0 bytes\n\ |
| -d SIZE, --data-stack-size=SIZE Specify data stack size\n\ |
-d SIZE, --data-stack-size=SIZE Specify data stack size\n\ |
| --debug Print debugging information during startup\n\ |
--debug Print debugging information during startup\n\ |
| argv[0]); |
argv[0]); |
| optind--; |
optind--; |
| return; |
return; |
| exit(0); |
|
| } |
} |
| } |
} |
| } |
} |