X-Git-Url: https://git.distorted.org.uk/~mdw/sw-tools/blobdiff_plain/3315e8b31a4707ef2c5491d0c9a9c9a09816bcb2..9796a7877cd1e7f6908c678e71b8fea6045ba0e7:/src/sw.c diff --git a/src/sw.c b/src/sw.c index 4f7b293..8423e64 100644 --- a/src/sw.c +++ b/src/sw.c @@ -1,6 +1,6 @@ /* -*-c-*- * - * $Id: sw.c,v 1.1 1999/06/02 16:53:33 mdw Exp $ + * $Id: sw.c,v 1.4 2004/04/08 01:52:19 mdw Exp $ * * Main driver code for sw-tools * @@ -26,14 +26,6 @@ * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/*----- Revision history --------------------------------------------------* - * - * $Log: sw.c,v $ - * Revision 1.1 1999/06/02 16:53:33 mdw - * Initial revision - * - */ - /*----- Header files ------------------------------------------------------*/ #include "config.h" @@ -85,7 +77,7 @@ static cmd *cmds = CMD_LINK; const char *opt_output = 0; const char *opt_arch = 0; -unsigned int opt_flags; +unsigned int opt_flags = optFlag_percent; /*----- Helpful GNUy message routines -------------------------------------*/ @@ -100,7 +92,7 @@ static void version(FILE *fp) static void usage(FILE *fp) { - fprintf(fp, "Usage: %s [-fbi] [-a arch,...] [-o style] command [args]\n", + fprintf(fp, "Usage: %s [-fbip] [-a arch,...] [-o style] command [args]\n", QUIS); } @@ -121,6 +113,7 @@ There are some options which affect a few of the available commands:\n\ -b, --beep Beep when the build is complete.\n\ -i, --install Mark architectures as done when build succeeds.\n\ -f, --force Run build commands on installed architectures.\n\ +-p, --percent Enable `%'-escapes in build command arguments.\n\ -o, --output=STYLE Display output in a particular style. Use style\n\ `help' for a list.\n\ \n", fp); @@ -193,7 +186,9 @@ int main(int argc, char *argv[]) { "force", 0, 0, 'f' }, { "install", 0, 0, 'i' }, { "output", OPTF_ARGREQ, 0, 'o' }, - { "beep", 0, 0, 'b' }, + { "beep", OPTF_NEGATE, 0, 'b' }, + { "percent", OPTF_NEGATE, 0, 'p' }, + { "escape", OPTF_NEGATE, 0, 'p' }, /* --- Internal-use-only magical options --- * * @@ -207,7 +202,8 @@ int main(int argc, char *argv[]) { 0, 0, 0, 0 } }; - int i = mdwopt(argc, argv, "+hHvu a:bfio:", opt, 0, 0, gFlag_envVar); + int i = mdwopt(argc, argv, "+hHvu a:b+p+fio:", opt, 0, 0, + OPTF_ENVVAR | OPTF_NEGATION); if (i < 0) break; @@ -239,6 +235,15 @@ int main(int argc, char *argv[]) case 'b': opt_flags |= optFlag_beep; break; + case 'b' | OPTF_NEGATED: + opt_flags &= ~optFlag_beep; + break; + case 'p': + opt_flags |= optFlag_percent; + break; + case 'p' | OPTF_NEGATED: + opt_flags &= ~optFlag_percent; + break; case 'i': opt_flags |= optFlag_install; break;