[BusyBox] Changing the way help is displayed...

Vladimir N. Oleynik dzo at simtreas.ru
Sun Apr 15 07:12:43 UTC 2001


Manuel Novoa III wrote:
 
> On Fri, 13 Apr 2001, Tom Cameron wrote:
> > Hello all,
> >       I have a wacky topic for discussion.  Would it be more size
> > efficient if the help text wasn't stored in the BB binary _at_all_?  By
> > this I mean, don't have any short or long help compiled into the binary
> > file.  Instead, dynamically read the help text from a file.  What do
> > people think?  Obviously the file would have to be "tagged" in some way
> > so that not ALL of the help topics are displayed...but only the one for
> > the applet being executed.  Any thoughts?  If you think of the number of
> > bytes used by the help text for each and every applet in the BB binary,
> > I think having one re-used function would be smaller...but again, I have
> > no real factual numbers...as I wouldn't really know where to begin.
> >       Doing something like this would also allow the developer to
> > chose short or long help messages...and upon compiling BB, the help file
> > would be created accordingly.  Additionally, this would allow for a
> > "help-less" system, as the developer could simply delete the file.  Just
> > a thought.  Let me know what you all think...it may be worth looking
> > into.
> 
> One of the motivations for replacing all the seperate usage message strings
> with one long string was to allow putting the usage messages in a seperate
> file.  All one really needs to do is modify the show_usage function in
> applets.c to read from a file instead of accessing "usage_messages".
> 
> Of course, you need to deal with issues like help file missing, corrupted,
> inappropriate version, etc.  But those changes would all be local to
> show_usage.  You could even keep the file compressed if you had unzip
> capability built into busybox.
> 
> One other problem is generating the help file from usage.c.  In the past, Erik
> has frowned upon using c-code to build intermediate tools used in the build,
> even though that seems to be the easiest approach to me.

Quick idea:

#ifndef BB_AR
#error Require 'ar' applet
#endif

show_usage() 
{
	static char help_ar_cmd[]="ar p " BB_HELPS_ARHIVE " ";
	char *ucmd = alloca(sizeof(help_ar_cmd)+strlen(applet_name));

	strcpy(ucmd, help_ar_cmd);
	strcat(ucmd, applet_name);
	system(ucmd);
}


I already for a long time am tormented by connection to each new version
additional applets,
besides many other difficulties about which I am already tired argue with
maintainers, 
there is a difficulty and in creation shown_usage() as in the current situation
the idea
contrib applets without numerous corrections in the project essentially is not
possible.


--w
vodz





More information about the busybox mailing list