9
0
Fork 0

of_* commands: print usage when insufficient arguments are given

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Sascha Hauer 2013-02-26 19:53:37 +01:00
parent 9d8e08353c
commit c932896af9
2 changed files with 6 additions and 0 deletions

View File

@ -54,6 +54,9 @@ static int do_of_node(int argc, char *argv[])
}
}
if (optind == argc)
return COMMAND_ERROR_USAGE;
if (optind < argc) {
path = argv[optind];
}

View File

@ -192,6 +192,9 @@ static int do_of_property(int argc, char *argv[])
}
}
if (optind == argc)
return COMMAND_ERROR_USAGE;
root = of_get_root_node();
if (!root) {
printf("root node not set\n");