)
parser.add_argument('--version', '-v', action='version', version=f'%(prog)s {VERSION}')
- parser.add_argument('--file', '-f', action='store', required=True,
+ parser.add_argument('--file', '-f', action='store',
help='Pass annotations or .config file to be parsed')
parser.add_argument('--arch', '-a', action='store',
help='Select architecture')
print(f"check-config: {good}/{total} checks passed -- exit {ret}")
exit(ret)
+def autodetect_annotations(args):
+ if args.file:
+ return
+ # If --file/-f isn't specified try to automatically determine the right
+ # location of the annotations file looking at debian/debian.env.
+ try:
+ with open('debian/debian.env', 'rt') as fd:
+ args.file = fd.read().rstrip().split('=')[1] + '/config/annotations'
+ except:
+ print('error: could not determine DEBDIR, try using: --file/-f')
+
def main():
args = _ARGPARSER.parse_args()
+ autodetect_annotations(args)
if args.query:
do_query(args)
elif args.export: