aboutsummaryrefslogtreecommitdiffstats
path: root/tools/nv_data-imei.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/nv_data-imei.c')
-rw-r--r--tools/nv_data-imei.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/tools/nv_data-imei.c b/tools/nv_data-imei.c
index 766c7a8..64ce3f5 100644
--- a/tools/nv_data-imei.c
+++ b/tools/nv_data-imei.c
@@ -1021,11 +1021,12 @@ int main(int argc, char * const argv[])
/* We use the - in optstring so all arguments go in the 'case 1:' */
assert(optind == argc);
- if (argc == 2) {
+ if (argc == 2 || command == NULL) {
/* If none of the commands or options were reached, we are in
- * the case where users ran 'nv_data-imei FILE'.
+ * the case where users ran 'nv_data-imei FILE' or used some
+ * options like -i <argument> without any command.
*/
- printf("Missing options, commands or invalid command '%s'\n",
+ printf("Missing options, command or invalid command '%s'\n",
argv[1]);
printf("Try -h to print the help.\n");
return EX_USAGE;