aboutsummaryrefslogtreecommitdiff
path: root/lib/help.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/help.c')
-rw-r--r--lib/help.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/help.c b/lib/help.c
index 7b97e8b9..86d6392b 100644
--- a/lib/help.c
+++ b/lib/help.c
@@ -16,10 +16,10 @@ static char *help_data =
#include "generated/newtoys.h"
;
-void show_help(FILE *out)
+void show_help(FILE *out, int full)
{
int i = toys.which-toy_list;
- char *s;
+ char *s, *ss;
if (CFG_TOYBOX_HELP) {
for (;;) {
@@ -30,6 +30,11 @@ void show_help(FILE *out)
i = toy_find(++s)-toy_list;
}
- fprintf(out, "%s\n", s);
+ if (full) fprintf(out, "%s\n", s);
+ else {
+ strstart(&s, "usage: ");
+ for (ss = s; *ss && *ss!='\n'; ss++);
+ fprintf(out, "%.*s\n", (int)(ss-s), s);
+ }
}
}