Skip to content

Commit

Permalink
Standardize command usage messages with cmd_usage()
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Tyser <[email protected]>
  • Loading branch information
Peter Tyser authored and wdenx committed Jan 28, 2009
1 parent 84cde2b commit 62c3ae7
Show file tree
Hide file tree
Showing 89 changed files with 213 additions and 206 deletions.
2 changes: 1 addition & 1 deletion board/BuS/EB+MCF-EV123/EB+MCF-EV123.c
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ int do_vcimage (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
rcode = 0;
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
rcode = 1;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion board/ads5121/ads5121_diu.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ int ads5121diu_init_show_bmp(cmd_tbl_t *cmdtp,
unsigned int addr;

if (argc < 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/amcc/acadia/cmd_acadia.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
int cpu_freq;

if (argc < 3) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/amcc/canyonlands/bootstrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
extern char console_buffer[];

if (argc < 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/amcc/katmai/cmd_katmai.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char pcixClock[4];

if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
6 changes: 3 additions & 3 deletions board/amcc/kilauea/cmd_pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char c = '\0';
pll_freq_t pll_freq;
if (argc < 2) {
printf("Usage: \n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
goto ret;
}

Expand Down Expand Up @@ -222,8 +222,8 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
goto ret;

default:
printf("Invalid options"
"\n\nUsage: \n%s\n", cmdtp->usage);
printf("Invalid options\n\n");
cmd_usage(cmdtp);
goto ret;
}

Expand Down
2 changes: 1 addition & 1 deletion board/amcc/luan/luan.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ int do_l2cache( cmd_tbl_t *cmdtp, int flag, int argc, char *argv[] )
l2cache_status() ? "ON" : "OFF");
return 0;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
6 changes: 3 additions & 3 deletions board/amcc/makalu/cmd_pll.c
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char c = '\0';
pll_freq_t pll_freq;
if (argc < 2) {
printf("Usage: \n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
goto ret;
}

Expand Down Expand Up @@ -222,8 +222,8 @@ do_pll_alter (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
goto ret;

default:
printf("Invalid options"
"\n\nUsage: \n%s\n", cmdtp->usage);
printf("Invalid options\n\n");
cmd_usage(cmdtp);
goto ret;
}

Expand Down
2 changes: 1 addition & 1 deletion board/amcc/sequoia/cmd_sequoia.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ static int do_bootstrap(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
extern char console_buffer[];

if (argc < 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/amcc/yucca/cmd_yucca.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ static int setBootStrapClock(cmd_tbl_t *cmdtp, int incrflag, int flag,
char pcixClock[4];

if (argc < 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/barco/barco.c
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ int barcobcd_boot_image (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
#if 0
if (argc > 1) {
printf ("Usage:\n (%d) %s\n", argc, cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
#endif
Expand Down
2 changes: 1 addition & 1 deletion board/esd/common/lcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,7 @@ int do_esdbmp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *str;
#endif
if (argc != 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/esd/dasa_sim/cmd_dasa_sim.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ int do_pci9054 (cmd_tbl_t * cmdtp, int flag, int argc,
return 0;
}

printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;

}
Expand Down
4 changes: 2 additions & 2 deletions board/freescale/common/sys_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
prog_eeprom();
break;
default:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
break;
}

Expand Down Expand Up @@ -362,7 +362,7 @@ int do_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
break;
case 'h': /* help */
default:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
break;
}

Expand Down
2 changes: 1 addition & 1 deletion board/freescale/mpc8610hpcd/mpc8610hpcd_diu.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ int mpc8610diu_init_show_bmp(cmd_tbl_t *cmdtp,
unsigned int addr;

if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions board/hymod/bsp.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ do_fpga (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
break;
}

printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
U_BOOT_CMD(
Expand Down Expand Up @@ -324,7 +324,7 @@ do_eecl (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
/* fall through ... */

default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions board/lwmon/lwmon.c
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ int do_pic (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
U_BOOT_CMD(
Expand Down Expand Up @@ -976,7 +976,7 @@ int do_lsb (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions board/lwmon5/lwmon5.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ void hw_watchdog_reset(void)
int do_eeprom_wp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
if (argc < 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand All @@ -476,7 +476,7 @@ int do_eeprom_wp(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
} else if ((strcmp(argv[1], "off") == 0)) {
gpio_write_bit(CONFIG_SYS_GPIO_EEPROM_EXT_WP, 0);
} else {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/mpl/common/common_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -559,7 +559,7 @@ int do_mplcommon(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;
}
#endif
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/pcippc2/pcippc2.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ int do_wd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/pcs440ep/pcs440ep.c
Original file line number Diff line number Diff line change
Expand Up @@ -780,7 +780,7 @@ int do_sha1 (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])

if (argc < 2) {
usage:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions board/pn62/cmd_pn62.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ int do_led (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
unsigned int number, function;

if (argc != 3) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
number = simple_strtoul(argv[1], NULL, 10);
Expand Down Expand Up @@ -83,7 +83,7 @@ int do_loadpci (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
addr = simple_strtoul(argv[1], NULL, 16);
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/prodrive/pdnb3/pdnb3.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ int do_fpga(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
ulong addr;

if (argc < 2) {
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions board/renesas/sh7785lcr/rtl8169_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ int do_set_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *s, *e;

if (argc != 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand All @@ -331,7 +331,7 @@ U_BOOT_CMD(
int do_print_mac(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
if (argc != 1) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
4 changes: 2 additions & 2 deletions board/renesas/sh7785lcr/selfcheck.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ int do_hw_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
char *cmd;

if (argc != 2) {
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down Expand Up @@ -150,7 +150,7 @@ int do_hw_test(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
test_net();
break;
default:
printf("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/siemens/common/fpga.c
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ int do_fpga (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return 0;

failure:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/siemens/pcu_e/pcu_e.c
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ int do_puma (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/ssv/common/cmd_sled.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ int do_sled (cmd_tbl_t * cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
2 changes: 1 addition & 1 deletion board/ssv/common/wd_pio.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ int do_wd (cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
default:
break;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
12 changes: 6 additions & 6 deletions board/tqc/tqm5200/cmd_stk52xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
switch (argc) {
case 0:
case 1:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 2:
if (strncmp(argv[1],"saw",3) == 0) {
Expand All @@ -342,7 +342,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
return rcode;
}

printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 3:
if (strncmp(argv[1],"saw",3) == 0) {
Expand All @@ -358,7 +358,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
LEFT_RIGHT);
return rcode;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 4:
if (strncmp(argv[1],"saw",3) == 0) {
Expand All @@ -382,7 +382,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
pcm1772_write_reg((uchar)reg, (uchar)val);
return 0;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
case 5:
if (strncmp(argv[1],"saw",3) == 0) {
Expand Down Expand Up @@ -412,7 +412,7 @@ static int cmd_sound(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
channel);
return rcode;
}
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}
printf ("Usage:\nsound cmd [arg1] [arg2] ...\n");
Expand Down Expand Up @@ -513,7 +513,7 @@ static int cmd_beep(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
channel = LEFT_RIGHT;
break;
default:
printf ("Usage:\n%s\n", cmdtp->usage);
cmd_usage(cmdtp);
return 1;
}

Expand Down
Loading

0 comments on commit 62c3ae7

Please sign in to comment.