Add cmd_process() to process commands in one place
authorSimon Glass <sjg@chromium.org>
Tue, 14 Feb 2012 19:59:25 +0000 (19:59 +0000)
committerWolfgang Denk <wd@denx.de>
Tue, 6 Mar 2012 20:09:41 +0000 (21:09 +0100)
commit9d12d5d41d5653ba2f943886f45b8c2eb0f63450
tree03ea18e10cb7c8f06bf82525c8aacad91938ad93
parent7344f9128dfa797a9b9d51b38832f77a1eaeac2d
Add cmd_process() to process commands in one place

We currently have the same code in hush.c and main.c. This brings the
code into one place.

As an added feature, if the command function returns CMD_RET_USAGE then
cmd_process() will print a usage message for the command before
returning the standard failure code of 1.

ARM code size increases about 32 bytes with this clean-up.

Signed-off-by: Simon Glass <sjg@chromium.org>
common/command.c
common/hush.c
common/main.c
include/command.h