1
0
mirror of git://projects.qi-hardware.com/eda-tools.git synced 2024-11-17 23:22:28 +02:00

genex/genex.c: new option -d to dump the tree instead of making a PDF

This commit is contained in:
Werner Almesberger 2012-04-17 05:43:46 -03:00
parent 1b7ace9043
commit 904a60f7f9

View File

@ -22,7 +22,8 @@
static void usage(const char *name) static void usage(const char *name)
{ {
fprintf(stderr, fprintf(stderr,
"usage: %s [-L libdir ...] [-l lib ...] hierarchy [descriptions ...]\n\n" "usage: %s [-d] [-L libdir ...] [-l lib ...] hierarchy [descriptions ...]\n\n"
" -d dump the tree instead of generating a PDF\n"
" -L libdir search all libraries in the specified directory\n" " -L libdir search all libraries in the specified directory\n"
" -l lib search the specified component library\n" " -l lib search the specified component library\n"
, name); , name);
@ -34,10 +35,14 @@ int main(int argc, char **argv)
{ {
FILE *file; FILE *file;
int c; int c;
int dump = 0;
char **arg; char **arg;
while ((c = getopt(argc, argv, "L:l:")) != EOF) while ((c = getopt(argc, argv, "dL:l:")) != EOF)
switch (c) { switch (c) {
case 'd':
dump = 1;
break;
case 'L': case 'L':
add_libdir(optarg); add_libdir(optarg);
break; break;
@ -74,7 +79,9 @@ int main(int argc, char **argv)
read_desc(file); read_desc(file);
fclose(file); fclose(file);
} }
// dump_tree(); if (dump)
make_pdf(); dump_tree();
else
make_pdf();
return 0; return 0;
} }