mirror of
https://github.com/sharkcz/rkdeveloptool.git
synced 2025-02-13 22:36:47 +01:00
main: support lower case command
people use lower case more than upper case. so we should support lower case command Signed-off-by: Eddie Cai <eddie.cai.linux@gmail.com>
This commit is contained in:
parent
a8d2345885
commit
8df2d64a80
11
main.cpp
11
main.cpp
@ -1275,14 +1275,19 @@ bool handle_command(int argc, char* argv[], CRKScan *pScan)
|
||||
strCmd = argv[1];
|
||||
ssize_t cnt;
|
||||
bool bRet,bSuccess = false;
|
||||
int ret;
|
||||
char *s;
|
||||
int i, ret;
|
||||
STRUCT_RKDEVICE_DESC dev;
|
||||
|
||||
transform(strCmd.begin(), strCmd.end(), strCmd.begin(), (int(*)(int))toupper);
|
||||
if(strcmp(strCmd.c_str(), "-H") == 0) {
|
||||
s = (char*)strCmd.c_str();
|
||||
for(i = 0; i < (int)strlen(s); i++)
|
||||
s[i] = toupper(s[i]);
|
||||
printf("handle_command: %s\n", strCmd.c_str());
|
||||
if((strcmp(strCmd.c_str(), "-H") == 0) || (strcmp(strCmd.c_str(), "--HELP")) == 0){
|
||||
usage();
|
||||
return true;
|
||||
} else if(strcmp(strCmd.c_str(), "-V") == 0) {
|
||||
} else if((strcmp(strCmd.c_str(), "-V") == 0) || (strcmp(strCmd.c_str(), "--VERSION") == 0)) {
|
||||
printf("rkdeveloptool ver %s\r\n", PACKAGE_VERSION);
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user