annotations: allow to query CONFIG_<option> or just <option>
authorAndrea Righi <andrea.righi@canonical.com>
Thu, 1 Dec 2022 10:05:52 +0000 (11:05 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Thu, 1 Dec 2022 10:05:52 +0000 (11:05 +0100)
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
annotations

index 78a8486097b7925cfd7fa133bf93b07e5405148a..c437787ce638db188f9b15853a80a0218bb98814 100755 (executable)
@@ -62,8 +62,11 @@ def arg_fail(message):
 
 def do_query(args):
     a = Annotation(args.file)
-    res = a.search_config(config=args.config, arch=args.arch, flavour=args.flavour)
-    print(json.dumps(res, indent=4))
+    for config in (args.config, 'CONFIG_' + args.config if args.config else None):
+        res = a.search_config(config=config, arch=args.arch, flavour=args.flavour)
+        if res:
+            break
+    print(json.dumps({config or '*': res}, indent=4))
 
 def do_note(args):
     if args.config is None: