FreeCalypso > hg > freecalypso-hwlab
comparison fteeprom/fteeprom-read.c @ 42:c4b9026c8875
fteeprom-{prog,read}: -t option replaced with -b and -B
author | Mychaela Falconia <falcon@freecalypso.org> |
---|---|
date | Mon, 22 Apr 2019 01:17:07 +0000 |
parents | 16b625911e19 |
children |
comparison
equal
deleted
inserted
replaced
41:79cdd210abe1 | 42:c4b9026c8875 |
---|---|
12 process_cmdline(argc, argv) | 12 process_cmdline(argc, argv) |
13 char **argv; | 13 char **argv; |
14 { | 14 { |
15 int c; | 15 int c; |
16 extern int optind; | 16 extern int optind; |
17 extern char *optarg; | |
18 | 17 |
19 while ((c = getopt(argc, argv, "t:")) != EOF) { | 18 while ((c = getopt(argc, argv, "bB")) != EOF) { |
20 switch (c) { | 19 switch (c) { |
21 case 't': | 20 case 'b': |
22 if (!strcmp(optarg, "46")) | 21 eeprom_size = 128; |
23 eeprom_size = 64; | 22 continue; |
24 else if (!strcmp(optarg, "56")) | 23 case 'B': |
25 eeprom_size = 128; | 24 eeprom_size = 256; |
26 else if (!strcmp(optarg, "66")) | |
27 eeprom_size = 256; | |
28 else { | |
29 fprintf(stderr, | |
30 "error: -t option invalid value \"%s\"\n", | |
31 optarg); | |
32 exit(1); | |
33 } | |
34 continue; | 25 continue; |
35 default: | 26 default: |
36 /* error msg already printed */ | 27 /* error msg already printed */ |
37 exit(1); | 28 exit(1); |
38 } | 29 } |