summaryrefslogtreecommitdiffstats
path: root/commands/state.c
diff options
context:
space:
mode:
authorEnrico Jorns <ejo@pengutronix.de>2015-10-25 22:03:31 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2015-11-27 08:26:40 +0100
commit446f3d07dd59f1b15b83a31fa88fba919ce4f47d (patch)
treef085fa1ee8e49c55a81f43454d1cd4f2a4d76d1f /commands/state.c
parent7098d7121e98a8a9bcda726c1a35ac2d0f29de65 (diff)
downloadbarebox-446f3d07dd59f1b15b83a31fa88fba919ce4f47d.tar.gz
state: disable load command
Explicitly loading environment is not required as it will be loaded if available during device probing Signed-off-by: Enrico Jorns <ejo@pengutronix.de> Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'commands/state.c')
-rw-r--r--commands/state.c19
1 files changed, 5 insertions, 14 deletions
diff --git a/commands/state.c b/commands/state.c
index 59d1eb8..4b51759 100644
--- a/commands/state.c
+++ b/commands/state.c
@@ -21,26 +21,20 @@ static int do_state(int argc, char *argv[])
{
int opt, ret = 0;
struct state *state = NULL;
- int do_save = 0, do_load = 0;
+ int do_save = 0;
const char *statename = "state";
- while ((opt = getopt(argc, argv, "sl")) > 0) {
+ while ((opt = getopt(argc, argv, "s")) > 0) {
switch (opt) {
case 's':
do_save = 1;
break;
- case 'l':
- do_load = 1;
- break;
default:
return COMMAND_ERROR_USAGE;
}
}
- if (do_save && do_load)
- return COMMAND_ERROR_USAGE;
-
- if (!do_save && !do_load) {
+ if (!do_save) {
state_info();
return 0;
}
@@ -56,8 +50,6 @@ static int do_state(int argc, char *argv[])
if (do_save)
ret = state_save(state);
- else if (do_load)
- ret = state_load(state);
return ret;
}
@@ -67,13 +59,12 @@ BAREBOX_CMD_HELP_TEXT("Usage: state [OPTIONS] [STATENAME]")
BAREBOX_CMD_HELP_TEXT("")
BAREBOX_CMD_HELP_TEXT("options:")
BAREBOX_CMD_HELP_OPT ("-s", "save state")
-BAREBOX_CMD_HELP_OPT ("-l", "load state")
BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(state)
.cmd = do_state,
- BAREBOX_CMD_DESC("load and save state information")
- BAREBOX_CMD_OPTS("[-sl] [STATENAME]")
+ BAREBOX_CMD_DESC("save state information")
+ BAREBOX_CMD_OPTS("[-s] [STATENAME]")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
BAREBOX_CMD_HELP(cmd_state_help)
BAREBOX_CMD_END