aboutsummaryrefslogtreecommitdiff
path: root/lib/lib.c
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2007-10-11 15:36:36 -0500
committerRob Landley <rob@landley.net>2007-10-11 15:36:36 -0500
commitd06c58df5c723594c4f214dd5d1842a178d2a5e1 (patch)
tree82d61cb9ff7de99de7702e6f8d7cf5d4ecca7bed /lib/lib.c
parent103b7e031c4de0f9753e02d2217aa81819242278 (diff)
downloadtoybox-d06c58df5c723594c4f214dd5d1842a178d2a5e1.tar.gz
Promote help to global config option, teach error_exit() to output usage message when called
from get_optflags().
Diffstat (limited to 'lib/lib.c')
-rw-r--r--lib/lib.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/lib.c b/lib/lib.c
index 7cb29f8f..fe85c5fe 100644
--- a/lib/lib.c
+++ b/lib/lib.c
@@ -55,6 +55,12 @@ void error_exit(char *msg, ...)
{
va_list va;
+ if (CFG_HELP && toys.exithelp) {
+ *toys.optargs=*toys.argv;
+ help_main();
+ fprintf(stderr,"\n");
+ }
+
va_start(va, msg);
verror_msg(msg, 0, va);
va_end(va);
@@ -75,12 +81,6 @@ void perror_exit(char *msg, ...)
exit(toys.exitval);
}
-// Stub until the online help system goes in.
-void usage_exit(void)
-{
- exit(1);
-}
-
// Die unless we can allocate memory.
void *xmalloc(size_t size)
{