/* -*-c-*-
*
- * $Id: sw.c,v 1.2 1999/07/16 12:50:43 mdw Exp $
+ * $Id: sw.c,v 1.3 1999/09/10 15:27:32 mdw Exp $
*
* Main driver code for sw-tools
*
/*----- Revision history --------------------------------------------------*
*
* $Log: sw.c,v $
+ * Revision 1.3 1999/09/10 15:27:32 mdw
+ * Include `%'-escape substitution.
+ *
* Revision 1.2 1999/07/16 12:50:43 mdw
* Replace deprecated `mdwopt' flag name with new version.
*
const char *opt_output = 0;
const char *opt_arch = 0;
-unsigned int opt_flags;
+unsigned int opt_flags = optFlag_percent;
/*----- Helpful GNUy message routines -------------------------------------*/
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);
}
-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);
{ "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 --- *
*
{ 0, 0, 0, 0 }
};
- int i = mdwopt(argc, argv, "+hHvu a:bfio:", opt, 0, 0, OPTF_ENVVAR);
+ int i = mdwopt(argc, argv, "+hHvu a:b+p+fio:", opt, 0, 0,
+ OPTF_ENVVAR | OPTF_NEGATION);
if (i < 0)
break;
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;