/*
- * (C) Copyright 2014 Leo C. <erbl259-lmu@yahoo.de>
+ * (C) Copyright 2014,2016 Leo C. <erbl259-lmu@yahoo.de>
*
* Copyright 2000-2009
* Wolfgang Denk, DENX Software Engineering, wd@denx.de.
*
- * SPDX-License-Identifier: GPL-2.0+
+ * SPDX-License-Identifier: GPL-2.0
*/
-#include "common.h"
-#include <stdlib.h>
+#include "cmd_misc.h"
+#include "eval_arg.h"
#include <stdbool.h>
-#include "command.h"
#include "timer.h"
#include "con-utils.h"
#include "getopt-min.h"
-command_ret_t do_echo(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+command_ret_t do_echo(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[])
{
bool put_newline = true;
(void) cmdtp; (void) flag;
/* reset getopt() */
- optind = 1;
+ optind = 0;
int opt;
while ((opt = getopt(argc, argv, PSTR("n"))) != -1) {
}
-command_ret_t do_sleep(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[])
+command_ret_t do_sleep(cmd_tbl_t *cmdtp, uint_fast8_t flag, int argc, char * const argv[])
{
unsigned long start = get_timer(0);
unsigned long delay;
if (argc != 2)
return CMD_RET_USAGE;
- delay = strtoul(argv[1], &sp, 10);
+ delay = eval_arg(argv[1], &sp);
if (*sp == 'm') {
millisec = 1;