From 772857231b176f5134ff2f43e0cda5be93155509 Mon Sep 17 00:00:00 2001 From: phk Date: Sat, 25 Feb 1995 07:25:31 +0000 Subject: Add a '-l' option, which lists the argv[0]'s we will respond to. This will simplify the src/release Makefile quite a bit. --- usr.sbin/crunch/crunchgen/crunchgen.1 | 4 +++- usr.sbin/crunch/crunchgen/crunchgen.c | 15 +++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) (limited to 'usr.sbin/crunch') diff --git a/usr.sbin/crunch/crunchgen/crunchgen.1 b/usr.sbin/crunch/crunchgen/crunchgen.1 index 8c97d66..078c44f 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.1 +++ b/usr.sbin/crunch/crunchgen/crunchgen.1 @@ -31,7 +31,7 @@ .Nd generates build environment for a crunched binary .Sh SYNOPSIS .Nm \&crunchgen -.Op Fl fq +.Op Fl fql .Op Fl m Ar makefile-name .Op Fl c Ar c-file-name .Op Fl e Ar exec-file-name @@ -86,6 +86,8 @@ Set crunched binary executable file name to The default name is ``''. .It Fl f Flush cache. Forces the recalculation of cached parameters. +.It Fl l +List names. Lists the names this binary will respond to. .It Fl m Ar makefile-name Set output Makefile name to .Ar makefile-name . diff --git a/usr.sbin/crunch/crunchgen/crunchgen.c b/usr.sbin/crunch/crunchgen/crunchgen.c index 6e9af18..2ed0e2b 100644 --- a/usr.sbin/crunch/crunchgen/crunchgen.c +++ b/usr.sbin/crunch/crunchgen/crunchgen.c @@ -86,6 +86,8 @@ char *pname = "crunchgen"; int verbose, readcache; /* options */ int reading_cache; +int list_mode; + /* general library routines */ void status(char *str); @@ -114,7 +116,7 @@ int main(int argc, char **argv) if(argc > 0) pname = argv[0]; - while((optc = getopt(argc, argv, "m:c:e:fq")) != -1) { + while((optc = getopt(argc, argv, "lm:c:e:fq")) != -1) { switch(optc) { case 'f': readcache = 0; break; case 'q': verbose = 0; break; @@ -122,6 +124,7 @@ int main(int argc, char **argv) case 'm': strcpy(outmkname, optarg); break; case 'c': strcpy(outcfname, optarg); break; case 'e': strcpy(execfname, optarg); break; + case 'l': list_mode++; verbose = 0; break; case '?': default: usage(); @@ -157,6 +160,9 @@ int main(int argc, char **argv) } parse_conf_file(); + if (list_mode) + exit(goterror); + gen_outputs(); exit(goterror); @@ -323,6 +329,8 @@ void add_prog(char *progname) p2->ident = p2->srcdir = p2->objdir = NULL; p2->links = p2->objs = NULL; p2->goterror = 0; + if (list_mode) + printf("%s\n",progname); } @@ -338,8 +346,11 @@ void add_link(int argc, char **argv) goterror = 1; return; } - for(i=2;ilinks, argv[i]); + } } -- cgit v1.1