FreeCalypso > hg > freecalypso-sw
comparison rvinterf/etm/main.c @ 200:2847b6cbd915
fc-tmsh rvinterf invokation mode: support passing -B as well
author | Michael Spacefalcon <msokolov@ivan.Harhan.ORG> |
---|---|
date | Thu, 19 Dec 2013 08:15:47 +0000 |
parents | fa7174faa9aa |
children |
comparison
equal
deleted
inserted
replaced
199:96f56e875862 | 200:2847b6cbd915 |
---|---|
11 char *socket_pathname = "/tmp/rvinterf_socket"; | 11 char *socket_pathname = "/tmp/rvinterf_socket"; |
12 int ttyhacks, dflag; | 12 int ttyhacks, dflag; |
13 | 13 |
14 int sock; | 14 int sock; |
15 | 15 |
16 extern char *rvinterf_lopt, *rvinterf_wopt; | 16 extern char *rvinterf_Bopt, *rvinterf_lopt, *rvinterf_wopt; |
17 | 17 |
18 main(argc, argv) | 18 main(argc, argv) |
19 char **argv; | 19 char **argv; |
20 { | 20 { |
21 extern int optind; | |
21 extern char *optarg; | 22 extern char *optarg; |
22 int c; | 23 int c; |
23 fd_set fds; | 24 fd_set fds; |
24 | 25 |
25 while ((c = getopt(argc, argv, "dl:s:w:")) != EOF) | 26 while ((c = getopt(argc, argv, "B:dl:s:w:")) != EOF) |
26 switch (c) { | 27 switch (c) { |
28 case 'B': | |
29 rvinterf_Bopt = optarg; | |
30 continue; | |
27 case 'd': | 31 case 'd': |
28 dflag++; | 32 dflag++; |
29 continue; | 33 continue; |
30 case 'l': | 34 case 'l': |
31 rvinterf_lopt = optarg; | 35 rvinterf_lopt = optarg; |
42 "usage: %s [options] [ttyport]\n", argv[0]); | 46 "usage: %s [options] [ttyport]\n", argv[0]); |
43 exit(1); | 47 exit(1); |
44 } | 48 } |
45 switch (argc - optind) { | 49 switch (argc - optind) { |
46 case 0: | 50 case 0: |
47 if (rvinterf_lopt || rvinterf_wopt) { | 51 if (rvinterf_Bopt || rvinterf_lopt || rvinterf_wopt) { |
48 fprintf(stderr, | 52 fprintf(stderr, |
49 "%s: -l and -w options are meaningful only when launching rvinterf\n", | 53 "%s: -B, -l and -w options are meaningful only when launching rvinterf\n", |
50 argv[0]); | 54 argv[0]); |
51 exit(1); | 55 exit(1); |
52 } | 56 } |
53 break; | 57 break; |
54 case 1: | 58 case 1: |