[U-Boot] [PATCH] cmd_mem.c: Fix help message alignment

Peter Tyser ptyser at xes-inc.com
Tue Aug 26 18:05:22 CEST 2008


On Tue, 2008-08-26 at 15:03 +0200, Wolfgang Denk wrote:
> Bug was introced by "Big white-space cleanup" (53677ef1)

s/introced/introduced/

> 
> Signed-off-by: Wolfgang Denk <wd at denx.de>
> ---
>  common/cmd_mem.c |   30 +++++++++++++++---------------
>  1 files changed, 15 insertions(+), 15 deletions(-)
> 
> diff --git a/common/cmd_mem.c b/common/cmd_mem.c
> index a78355c..4766c24 100644
> --- a/common/cmd_mem.c
> +++ b/common/cmd_mem.c
> @@ -1230,39 +1230,39 @@ int do_unzip ( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
>  #if defined(CONFIG_CMD_MEMORY)
>  U_BOOT_CMD(
>  	md,	3,	1,	do_mem_md,
> -	"md	 - memory display\n",
> +	"md	- memory display\n",
>  	"[.b, .w, .l] address [# of objects]\n	  - memory display\n"
>  );
>  

What is the preferred command indentation in general?

- Tabs or spaces? eg:
"dhcp\t- invoke DHCP client to obtain IP/boot params\n"
"exit    - exit script\n"


- What about commands that exceed the soft limit of 8 characters?  Are
they acceptable?  Should there be a space between the command and the -?
eg I currently see both:
"interrupts - enable or disable interrupts\n"
"reiserload- load binary file from a Reiser filesystem\n"


We've been "beautifying" customer-visible commands with more/less than 8
characters in the command help description and have standardized on
using tabs for the sole reason that it very slightly reduces the binary
size and is generally easier to align when adding new commands (ie
someone doesn't have to go to another command and count the number of
characters).

I've been using the following hokey shell command to find (hopefully)
all command help messages:
grep -r -A 2 U_BOOT_CMD ./* | grep -v U_BOOT_CMD | grep -v "\-\-" |
egrep "^.+\",$" | awk '{sub("(^./.*\.c-[ \t]+)", ""); print}'

I'd be happy to post these patches if desired.  If so, I'll wait till I
hear back about the preferred indentation method.

- Peter




More information about the U-Boot mailing list