diff --git a/genex/genex.c b/genex/genex.c index 29cd9f5..9649ace 100644 --- a/genex/genex.c +++ b/genex/genex.c @@ -22,7 +22,8 @@ static void usage(const char *name) { 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 lib search the specified component library\n" , name); @@ -34,10 +35,14 @@ int main(int argc, char **argv) { FILE *file; int c; + int dump = 0; char **arg; - while ((c = getopt(argc, argv, "L:l:")) != EOF) + while ((c = getopt(argc, argv, "dL:l:")) != EOF) switch (c) { + case 'd': + dump = 1; + break; case 'L': add_libdir(optarg); break; @@ -74,7 +79,9 @@ int main(int argc, char **argv) read_desc(file); fclose(file); } -// dump_tree(); - make_pdf(); + if (dump) + dump_tree(); + else + make_pdf(); return 0; }