From: wangbiao Date: Wed, 13 Mar 2024 07:16:44 +0000 (+0900) Subject: enable global arguament '-d' '-i' '-v' to mic create subcommands,because argparser... X-Git-Tag: accepted/tools/devbase/tools/legacy/20250527.042525~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa078b25c48c03ccee01f0f0de9111d8f219348f;p=tools%2Fmic.git enable global arguament '-d' '-i' '-v' to mic create subcommands,because argparser funciton change Change-Id: Iae0c3c5e525e2b748ff4748bce5b52f656f20841 Signed-off-by: wangbiao --- diff --git a/tools/mic b/tools/mic index 42b316b..314f370 100755 --- a/tools/mic +++ b/tools/mic @@ -270,6 +270,19 @@ def main(argv): # Parse arguments args = parser.parse_args(argv[1:]) + #now, If global opiton '-d' , '-v', '-i' is used, it will be not passed to mic create command. + #besides, there is same arguments in mic create command. + for debug_option in ('-d', '--debug'): + if debug_option in argv[1:]: + args.debug = True + + for verbose_option in ('-v', '--verbose'): + if verbose_option in argv[1:]: + args.verbose = True + #now, args.interactive will always be True even using --non-interactive, that's because it is rewirte by option '-i' + #for '-i', use it, action is True, without it, default value is True. + if '--non-interactive' in argv[1:]: + args.interactive = False if args.interactive: msger.enable_interactive() @@ -282,7 +295,7 @@ def main(argv): if args.debug: try: import rpm - rpm.setVerbosity(rpm.RPMLOG_DEBUG) + rpm.setVerbosity(rpm.RPMLOG_NOTICE) except ImportError: pass