]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
UBUNTU: [Packaging] annotations: assume --query as default command
authorAndrea Righi <andrea.righi@canonical.com>
Thu, 1 Dec 2022 09:49:19 +0000 (10:49 +0100)
committerAndrea Righi <andrea.righi@canonical.com>
Thu, 9 Mar 2023 14:58:10 +0000 (15:58 +0100)
This allows to quickly query config options without having to specifcy
"--query --config CONFIG", but just "--config CONFIG", for example:

  $ debian/scripts/misc/annotations -c CONFIG_DEBUG_INFO_BTF

Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
debian/scripts/misc/annotations

index e10fce49a56607854e023443a88b85b151133846..78a8486097b7925cfd7fa133bf93b07e5405148a 100755 (executable)
@@ -31,13 +31,13 @@ def make_parser():
                         help='Select flavour (default is "generic")')
     parser.add_argument('--config', '-c', action='store',
                         help='Select a specific config option')
+    parser.add_argument('--query', '-q', action='store_true',
+                        help='Query annotations')
 
-    ga = parser.add_argument_group(title='Action').add_mutually_exclusive_group(required=True)
+    ga = parser.add_argument_group(title='Action').add_mutually_exclusive_group(required=False)
     ga.add_argument('--write', '-w', action='store',
                         metavar='VALUE', dest='value',
                         help='Set a specific config value in annotations (use \'null\' to remove)')
-    ga.add_argument('--query', '-q', action='store_true',
-                        help='Query annotations')
     ga.add_argument('--note', '-n', action='store',
                         help='Write a specific note to a config option in annotations')
     ga.add_argument('--export', '-e', action='store_true',
@@ -198,7 +198,7 @@ def main():
         do_update(args)
     elif args.check_file:
         do_check(args)
-    elif args.query:
+    else:
         do_query(args)
 
 if __name__ == '__main__':