[PATCH 1/6] commands: nv: fail with verbose message if invoked without args

Enrico Jorns ejo at pengutronix.de
Wed Nov 1 00:27:05 PDT 2017


Signed-off-by: Enrico Jorns <ejo at pengutronix.de>
---
 commands/nv.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/commands/nv.c b/commands/nv.c
index 37cdb96647..798b1eaa04 100644
--- a/commands/nv.c
+++ b/commands/nv.c
@@ -55,8 +55,10 @@ static int do_nv(int argc, char *argv[])
 	argc -= optind;
 	argv += optind;
 
-	if (argc < 1)
+	if (argc < 1) {
+		printf("Invalid usage: Missing argument");
 		return COMMAND_ERROR_USAGE;
+	}
 
 	for (i = 0; i < argc; i++) {
 		value = strchr(argv[0], '=');
-- 
2.11.0




More information about the barebox mailing list