chiark
/
gitweb
/
~mdw
/
sw-tools
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
usage: Print metavariables in SHOUTY letters.
[sw-tools]
/
src
/
sw.c
diff --git
a/src/sw.c
b/src/sw.c
index 4f7b293a05361fa52cffb89db9df66ca79af3502..de963f84e35ae96f4c455d839c619286299eff39 100644
(file)
--- a/
src/sw.c
+++ b/
src/sw.c
@@
-1,6
+1,6
@@
/* -*-c-*-
*
/* -*-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
*
*
* Main driver code for sw-tools
*
@@
-26,14
+26,6
@@
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
* 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"
/*----- Header files ------------------------------------------------------*/
#include "config.h"
@@
-85,7
+77,7
@@
static cmd *cmds = CMD_LINK;
const char *opt_output = 0;
const char *opt_arch = 0;
const char *opt_output = 0;
const char *opt_arch = 0;
-unsigned int opt_flags;
+unsigned int opt_flags
= optFlag_percent
;
/*----- Helpful GNUy message routines -------------------------------------*/
/*----- Helpful GNUy message routines -------------------------------------*/
@@
-100,7
+92,7
@@
static void version(FILE *fp)
static void usage(FILE *fp)
{
static void usage(FILE *fp)
{
- fprintf(fp, "Usage: %s [-fbi
] [-a arch,...] [-o style] command [args
]\n",
+ fprintf(fp, "Usage: %s [-fbi
p] [-a ARCH,...] [-o STYLE] COMMAND [ARGS
]\n",
QUIS);
}
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\
-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);
-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' },
{ "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 --- *
*
/* --- Internal-use-only magical options --- *
*
@@
-207,7
+202,8
@@
int main(int argc, char *argv[])
{ 0, 0, 0, 0 }
};
{ 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;
if (i < 0)
break;
@@
-239,6
+235,15
@@
int main(int argc, char *argv[])
case 'b':
opt_flags |= optFlag_beep;
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;
case 'i':
opt_flags |= optFlag_install;
break;