summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1992-07-24 06:02:26 +0000
committerRoland McGrath <roland@redhat.com>1992-07-24 06:02:26 +0000
commit2e5f56539db7cfb857808380ab4d699fbb8d7dca (patch)
treef673d588c3a13fafd0e43c4cd371eb6afde7a566 /main.c
parenta63f4e1f9c3adbacf54417e2958ddcf51ca70b3e (diff)
downloadgunmake-2e5f56539db7cfb857808380ab4d699fbb8d7dca.tar.gz
Formerly main.c.~54~
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/main.c b/main.c
index ab4aab7..ad79453 100644
--- a/main.c
+++ b/main.c
@@ -91,7 +91,8 @@ struct command_switch
string, /* One string per switch. */
positive_int, /* A positive integer. */
floating, /* A floating-point number (double). */
- ignore /* Ignored. */
+ ignore, /* Ignored. */
+ usage_and_exit /* Ignored; exit after processing switches. */
} type;
char *value_ptr; /* Pointer to the value-holding variable. */
@@ -234,6 +235,10 @@ static struct command_switch switches[] =
{ 'f', string, (char *) &makefiles, 0, 0, 0, 0, 0,
"file", "FILE",
"Read FILE as a makefile" },
+ { 'h', usage_and_exit,
+ 0, 0, 0, 0, 0, 0,
+ "help", 0,
+ "Print this message and exit." },
{ 'i', flag, (char *) &ignore_errors_flag, 1, 1, 0, 0, 0,
"ignore-errors", 0,
"Ignore errors from commands" },
@@ -1095,6 +1100,10 @@ decode_switches (argc, argv)
case ignore:
break;
+ case usage_and_exit:
+ bad = 1;
+ break;
+
case flag:
case flag_off:
*(int *) cs->value_ptr = cs->type == flag;