comparison pads2gpcb/main.c @ 73:bdfd0b802bb0

pads2gpcb/main.c: preparations for main output of named and placed elements
author Mychaela Falconia <falcon@ivan.Harhan.ORG>
date Mon, 01 Feb 2016 00:29:36 +0000
parents fab9fc646044
children 58f11f06d831
comparison
equal deleted inserted replaced
72:fab9fc646044 73:bdfd0b802bb0
31 31
32 main(argc, argv) 32 main(argc, argv)
33 char **argv; 33 char **argv;
34 { 34 {
35 int c; 35 int c;
36 char *main_output;
36 extern int optind; 37 extern int optind;
37 extern char *optarg; 38 extern char *optarg;
38 39
39 while ((c = getopt(argc, argv, "fs:")) != EOF) 40 while ((c = getopt(argc, argv, "fs:")) != EOF)
40 switch (c) { 41 switch (c) {
45 do_footprint_silk = 1; 46 do_footprint_silk = 1;
46 select_drawlevel_for_silk(atoi(optarg)); 47 select_drawlevel_for_silk(atoi(optarg));
47 continue; 48 continue;
48 default: 49 default:
49 usage: 50 usage:
50 fprintf(stderr, "usage: %s [options] pads-file.asc\n", 51 fprintf(stderr,
52 "usage: %s [options] pads-file.asc [output.pcb]\n",
51 argv[0]); 53 argv[0]);
52 exit(1); 54 exit(1);
53 } 55 }
54 if (argc != optind + 1) 56 if (argc < optind + 1 || argc > optind + 2)
55 goto usage; 57 goto usage;
56 input_filename = argv[optind]; 58 input_filename = argv[optind];
59 main_output = argv[optind+1];
57 open_input_file(); 60 open_input_file();
58 61
59 /* parse the header line with the units specification */ 62 /* parse the header line with the units specification */
60 if (!get_input_line()) { 63 if (!get_input_line()) {
61 invheader: fprintf(stderr, 64 invheader: fprintf(stderr,