Modify usage of date command, kdbg_date
/****************************************************************************
*
- * Copyright 2016 Samsung Electronics All Rights Reserved.
+ * Copyright 2016-2017 Samsung Electronics All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -128,11 +128,6 @@ static inline int date_settime(int argc, char **args)
long result;
int ret = OK;
- token = args[1];
- if (token[0] != '-') {
- goto errout_bad_parm;
- }
- if (token[1] == 's') {
/* Get the month abbreviation */
token = args[2];
@@ -220,13 +215,11 @@ static inline int date_settime(int argc, char **args)
printf("clock_settime failed\n");
ret = ERROR;
}
- }
return ret;
errout_bad_parm:
printf("bad parameter\n");
-
return ERROR;
}
@@ -242,12 +235,18 @@ int kdbg_date(int argc, char **args)
if (argc == 1) {
ret = date_showtime();
- } else if (argc == 6) {
+ } else if (!strcmp(args[1], "-s") && argc == 6) {
ret = date_settime(argc, args);
} else {
- printf("Usage : date [-s MMM DD HH:MM:SS YYYY]\n");
+ printf("\nUsage: date\n");
+ printf(" or: date [-s FORMAT]\n");
+ printf("Display, or Set system time and date information\n");
+ printf("\nOptions:\n");
+ printf(" -s FORMAT Set system time in the given FORMAT\n");
+ printf(" FORMAT: MMM DD HH:MM:SS YYYY\n");
+ printf(" 'month', 'day', 'hour':'minute':'second' 'year'\n");
+ printf(" Example: Apr 21 10:35:22 1991\n");
ret = ERROR;
}
-
return ret;
}
