From: SangYoun Kwak Date: Wed, 2 Oct 2024 07:15:42 +0000 (+0900) Subject: Fix to print help message once X-Git-Tag: accepted/tizen/unified/20241006.053324~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=77418dc918327ecb5aa3286580edb335eb0e64ad;p=platform%2Fcore%2Fsystem%2Fupdate-control.git Fix to print help message once Previously, when '--help' option is provided, the help message was printed twice. To fix this issue, '--help' option is treated as an argument like other options and print help message if '--help' option is provided. Change-Id: I5026fcdfc95a60ea093e15c3860f85eeda3ad2b9 Signed-off-by: SangYoun Kwak --- diff --git a/tools/osu/osu.c b/tools/osu/osu.c index 524dbc3..58563df 100644 --- a/tools/osu/osu.c +++ b/tools/osu/osu.c @@ -28,6 +28,7 @@ struct arguments { + bool help; bool resize; bool update; bool online; @@ -40,6 +41,7 @@ static int parse_args(int argc, char **argv, struct arguments *args) assert(argv); assert(args); + args->help = false; args->resize = false; args->update = false; args->online = false; @@ -71,7 +73,7 @@ static int parse_args(int argc, char **argv, struct arguments *args) return 0; } case 'h': { - print_help(argv[0]); + args->help = true; return 0; } case '?': { @@ -109,6 +111,11 @@ int main(int argc, char **argv) return 1; } + if (args.help) { + print_help(argv[0]); + return 0; + } + if (args.resize) return do_resize();