enable global arguament '-d' '-i' '-v' to mic create subcommands,because argparser... 00/307800/4
authorwangbiao <biao716.wang@samsung.com>
Wed, 13 Mar 2024 07:16:44 +0000 (16:16 +0900)
committerwangbiao <biao716.wang@samsung.com>
Wed, 13 Mar 2024 09:20:04 +0000 (18:20 +0900)
Change-Id: Iae0c3c5e525e2b748ff4748bce5b52f656f20841
Signed-off-by: wangbiao <biao716.wang@samsung.com>
tools/mic

index 42b316b177dc06ce4cb56f7d773224c5da9b7660..314f370f6c555026d4fc545c91d5df631537fcaf 100755 (executable)
--- 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