From: biao716.wang Date: Fri, 21 Jul 2023 06:53:38 +0000 (+0900) Subject: enable global arguament '-d' '-i' '-v' to mic create subcommands X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=9e9cfcbe166361b5a04d62dda6b3690fcdeb579e;p=tools%2Fmic.git enable global arguament '-d' '-i' '-v' to mic create subcommands Change-Id: Ife1550c3740a62b15b39fbea3b5cd79c010153ab Signed-off-by: biao716.wang --- diff --git a/tools/mic b/tools/mic index 6cfcd49..e5e1e6d 100755 --- a/tools/mic +++ b/tools/mic @@ -271,6 +271,20 @@ def main(argv): # Parse arguments args = parser.parse_args(argv[1:]) + #In python3.x version, if global opiton '-d' , '-v', '-i' is used, it will be not passed to mic create command. + #beside, 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 + #for python3.x, 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() @@ -283,7 +297,7 @@ def main(argv): if args.debug: try: import rpm - rpm.setVerbosity(rpm.RPMLOG_DEBUG) + rpm.setVerbosity(rpm.RPMLOG_NOTICE) except ImportError: pass