Add 'true' and 'false' commands

These commands are only enabled when the hush shell is enabled and can
be useful in scripts such as:

while true do
    echo "Booting OS...";
    run $bootcmd;
    echo "Booting OS failed";
    sleep 10;
done

Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
This commit is contained in:
Peter Tyser 2009-10-16 17:36:27 -05:00 committed by Wolfgang Denk
parent 4e1ca93b6b
commit 396fd17338

View file

@ -149,3 +149,25 @@ U_BOOT_CMD(
"minimal test like /bin/sh",
"[args..]"
);
int do_false(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
return 1;
}
U_BOOT_CMD(
false, CONFIG_SYS_MAXARGS, 1, do_false,
"do nothing, unsuccessfully",
NULL
);
int do_true(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
return 0;
}
U_BOOT_CMD(
true, CONFIG_SYS_MAXARGS, 1, do_true,
"do nothing, successfully",
NULL
);