aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Landley <rob@landley.net>2020-10-28 17:03:37 -0500
committerRob Landley <rob@landley.net>2020-10-28 17:03:37 -0500
commit7b0ea0a21fb2d97c7bd24987f8ccf27548c0b004 (patch)
treee122684aeedcb0bbf5af09a42ebbf0759c4c1cc2
parent095891525bcb4fea341a27f75b5b5d52915cf5aa (diff)
downloadtoybox-7b0ea0a21fb2d97c7bd24987f8ccf27548c0b004.tar.gz
Tweak help text again.
-rw-r--r--Config.in2
-rw-r--r--lib/help.c5
-rw-r--r--main.c4
-rw-r--r--toys/other/help.c13
4 files changed, 14 insertions, 10 deletions
diff --git a/Config.in b/Config.in
index aced2ab9..f7407d85 100644
--- a/Config.in
+++ b/Config.in
@@ -15,8 +15,6 @@ config TOYBOX
help
usage: toybox [--long | --help | --version | [COMMAND] [ARGUMENTS...]]
- Toybox multicall binary: https://landley.net/toybox/about.html
-
With no arguments, "toybox" shows available COMMAND names. Add --long
to include suggested install path for each command, see
https://landley.net/toybox/faq.html#install for details.
diff --git a/lib/help.c b/lib/help.c
index 86d6392b..cd023026 100644
--- a/lib/help.c
+++ b/lib/help.c
@@ -21,6 +21,11 @@ void show_help(FILE *out, int full)
int i = toys.which-toy_list;
char *s, *ss;
+ if (!(full&2))
+ fprintf(out, "Toybox %s" USE_TOYBOX(" multicall binary")
+ ": https://landley.net/toybox"
+ USE_TOYBOX(" (see toybox --help)") "\n\n", toybox_version);
+
if (CFG_TOYBOX_HELP) {
for (;;) {
s = help_data;
diff --git a/main.c b/main.c
index ced2a65b..7c60bdf4 100644
--- a/main.c
+++ b/main.c
@@ -21,7 +21,7 @@ struct toy_list toy_list[] = {
struct toy_context toys;
union global_union this;
-char toybuf[4096], libbuf[4096];
+char *toybox_version = TOYBOX_VERSION, toybuf[4096], libbuf[4096];
struct toy_list *toy_find(char *name)
{
@@ -84,7 +84,7 @@ void toy_singleinit(struct toy_list *which, char *argv[])
}
if (!strcmp(argv[1], "--version")) {
- xputs("toybox "TOYBOX_VERSION);
+ xprintf("toybox %s\n", toybox_version);
xexit();
}
}
diff --git a/toys/other/help.c b/toys/other/help.c
index 179dd4e7..ab168c66 100644
--- a/toys/other/help.c
+++ b/toys/other/help.c
@@ -30,13 +30,13 @@ static void do_help(struct toy_list *t)
xprintf("<a name=\"%s\"><h1>%s</h1><blockquote><pre>\n", t->name, t->name);
toys.which = t;
- show_help(stdout, !FLAG(u));
+ show_help(stdout, FLAG(h)+!FLAG(u));
if (FLAG(h)) xprintf("</blockquote></pre>\n");
}
-// The simple help is just toys.which = toy_find("name"); show_help(stdout);
-// But iterating through html output and all commands is a big more
+// Simple help is just toys.which = toy_find("name"); show_help(stdout, 1);
+// but iterating through html output and all commands is a bit more
void help_main(void)
{
@@ -62,10 +62,11 @@ void help_main(void)
}
if (FLAG(h)) {
- xprintf("<html>\n<title>Toybox command list</title>\n<body>\n<p>\n");
+ sprintf(toybuf, "Toybox %s command help", toybox_version);
+ xprintf("<html>\n<title>%s</title>\n<body>\n<h1>%s</h1><hr /><p>",
+ toybuf, toybuf);
for (i=0; i < toys.toycount; i++)
- xprintf("<a href=\"#%s\">%s\n</a>\n", toy_list[i].name,
- toy_list[i].name);
+ xprintf("<a href=\"#%s\">%s</a> \n", toy_list[i].name, toy_list[i].name);
xprintf("</p>\n");
}