From: Shao Changbin Date: Mon, 21 Jan 2013 07:15:42 +0000 (-0500) Subject: fix issue of duplicate args of wrt-launcher X-Git-Tag: 2.1b_release~22^2~91^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3077ace0759e192c449180ade7462f8f722e9047;p=platform%2Fframework%2Fweb%2Fwrt.git fix issue of duplicate args of wrt-launcher [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 --- diff --git a/src/wrt-launcher/wrt-launcher.cpp b/src/wrt-launcher/wrt-launcher.cpp index 57fae6c..a1c2fa7 100644 --- a/src/wrt-launcher/wrt-launcher.cpp +++ b/src/wrt-launcher/wrt-launcher.cpp @@ -203,6 +203,8 @@ int main(int argc, char* argv[]) char op = '\0'; bool isDebugMode = false; struct sigaction sigact; + bool dispHelp = false; + bool dispList = false; service_h serviceHandle = NULL; int ret = SERVICE_ERROR_NONE; @@ -250,14 +252,20 @@ int main(int argc, char* argv[]) 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':