[Title] fix issue of duplicate args of wrt-launcher
[Issue#] N/A
[Problem] wrt-launcher doesn't handle duplicate arguments, for instance,
"wrt-launcher -l -l", it will print widget list twice.
[Cause] doesn't check argument before using
[Solution] check whether the argument has already parsed
Change-Id: Ic54605d1d55f79baf69526ce6dffcd784ecec46e
char op = '\0';
bool isDebugMode = false;
struct sigaction sigact;
+ bool dispHelp = false;
+ bool dispList = false;
service_h serviceHandle = NULL;
int ret = SERVICE_ERROR_NONE;
switch (next_opt) {
case 'h':
- print_help(stdout, 0);
+ if(!dispHelp){
+ print_help(stdout, 0);
+ dispHelp = true;
+ }
break;
case 'l':
+ if(dispList)
+ break;
if (!display_widget_info()) {
printf("Fail to display the list of installed widgets");
return -1;
}
+ dispList = true;
break;
case 's':