From 165637ce27a3bd0a7a7a4141461f191abdbd19f5 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Sat, 4 Jul 2015 11:39:44 -0600 Subject: [PATCH] The NSH shutdown option should be called --reboot, not --reset, for compatibility with the statndard shutdown command --- nshlib/README.txt | 9 +++++---- nshlib/nsh_command.c | 4 ++-- nshlib/nsh_syscmds.c | 10 +++++----- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/nshlib/README.txt b/nshlib/README.txt index 4b8a31c8e..611aa1c84 100644 --- a/nshlib/README.txt +++ b/nshlib/README.txt @@ -884,11 +884,12 @@ o sh Execute the sequence of NSH commands in the file referred to by . -o shutdown [--reset] +o shutdown [--reboot] - Shutdown and power off the system or, optionally, reset the system - immediately. This command depends on hardware support to power down or - reset the system; one, both, or neither behavior may be supported. + Shutdown and power off the system or, optionally, reset and reboot the + system immediately. This command depends on hardware support to power + down or reset the system; one, both, or neither behavior may be + supported. o sleep diff --git a/nshlib/nsh_command.c b/nshlib/nsh_command.c index 9af47dfe5..dbfa01eda 100644 --- a/nshlib/nsh_command.c +++ b/nshlib/nsh_command.c @@ -371,11 +371,11 @@ static const struct cmdmap_s g_cmdmap[] = #ifndef CONFIG_NSH_DISABLE_SHUTDOWN #if defined(CONFIG_BOARDCTL_POWEROFF) && defined(CONFIG_BOARDCTL_RESET) - { "shutdown", cmd_shutdown, 1, 2, "[--reset]" }, + { "shutdown", cmd_shutdown, 1, 2, "[--reboot]" }, #elif defined(CONFIG_BOARDCTL_POWEROFF) { "shutdown", cmd_shutdown, 1, 1, NULL }, #elif defined(CONFIG_BOARDCTL_RESET) - { "shutdown", cmd_shutdown, 2, 2, "--reset" }, + { "shutdown", cmd_shutdown, 2, 2, "--reboot" }, #endif #endif diff --git a/nshlib/nsh_syscmds.c b/nshlib/nsh_syscmds.c index 2495fb843..ba8b5c507 100644 --- a/nshlib/nsh_syscmds.c +++ b/nshlib/nsh_syscmds.c @@ -85,15 +85,15 @@ int cmd_shutdown(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) { #if defined(CONFIG_BOARDCTL_POWEROFF) && defined(CONFIG_BOARDCTL_RESET) /* If both shutdown and reset are supported, then a single option may - * be provided to select the reset behavior (--reset). We know here + * be provided to select the reset behavior (--reboot). We know here * that argc is either 1 or 2. */ if (argc == 2) { - /* Verify that the single argument is --reset */ + /* Verify that the single argument is --reboot */ - if (strcmp(argv[1], "--reset") != 0) + if (strcmp(argv[1], "--reboot") != 0) { nsh_output(vtbl, g_fmtarginvalid, argv[0]); return ERROR @@ -121,9 +121,9 @@ int cmd_shutdown(FAR struct nsh_vtbl_s *vtbl, int argc, char **argv) * argument has been provided. */ - /* Verify that the single argument is --reset */ + /* Verify that the single argument is --reboot */ - if (strcmp(argv[1], "--reset") != 0) + if (strcmp(argv[1], "--reboot") != 0) { nsh_output(vtbl, g_fmtarginvalid, argv[0]); return ERROR