summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>2018-08-06 21:14:18 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2018-08-08 09:29:37 +0200
commitff16f98a42801dbedf3ca9a2a2e88236cce9f672 (patch)
tree87dc3a8c62e7f097011424b1c5f0c5eb2717aae2
parentde2d437fd4193a67a1aacea214ed3a9d8b874922 (diff)
downloadbarebox-ff16f98a42801dbedf3ca9a2a2e88236cce9f672.tar.gz
barebox-ff16f98a42801dbedf3ca9a2a2e88236cce9f672.tar.xz
of_node: clarify help text and do stricter commandline parsing
To create an oftree node /path/node I tried after reading the help text of of_node: of_node -c /path node similar to the syntax of of_property. This didnt result in any output but still failed to do what I meant. So clarify the help text to not suggest there are two parameters and return an usage error if still two (or more) names are passed. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--commands/of_node.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/commands/of_node.c b/commands/of_node.c
index 29cc371dd..28c4357c5 100644
--- a/commands/of_node.c
+++ b/commands/of_node.c
@@ -107,11 +107,10 @@ static int do_of_node(int argc, char *argv[])
}
}
- if (optind == argc)
+ if (optind + 1 != argc)
return COMMAND_ERROR_USAGE;
- if (optind < argc)
- path = argv[optind];
+ path = argv[optind];
if (!path)
return COMMAND_ERROR_USAGE;
@@ -147,7 +146,7 @@ BAREBOX_CMD_HELP_END
BAREBOX_CMD_START(of_node)
.cmd = do_of_node,
BAREBOX_CMD_DESC("create/delete nodes in the device tree")
- BAREBOX_CMD_OPTS("[-cd] [-f] NODE NAME")
+ BAREBOX_CMD_OPTS("[-cd] [-f] NODEPATH")
BAREBOX_CMD_GROUP(CMD_GRP_MISC)
BAREBOX_CMD_COMPLETE(devicetree_complete)
BAREBOX_CMD_HELP(cmd_of_node_help)