From bfc7469f364f4a307dba8b13403d36f7720eb182 Mon Sep 17 00:00:00 2001 From: Moritz Warning Date: Thu, 13 Feb 2020 12:27:04 +0100 Subject: [PATCH] allow to use includes only --- misc/collect.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/misc/collect.py b/misc/collect.py index 2a89458..9b75351 100755 --- a/misc/collect.py +++ b/misc/collect.py @@ -7,8 +7,8 @@ import sys import os parser = argparse.ArgumentParser() -parser.add_argument("input_path", help="Input folder that is traversed for OpenWrt JSON device files.") -parser.add_argument('--link', required = True, +parser.add_argument("input_path", nargs='?', help="Input folder that is traversed for OpenWrt JSON device files.") +parser.add_argument('--link', action="store", dest="link", default="", help="Link to get the image from. May contain %%file, %%target, %%release and %%commit") parser.add_argument('--include', nargs='+', default=[], @@ -78,7 +78,6 @@ for path in paths: sys.stderr.write("Abort on {}\n Missing key {}\n".format(path, e)) exit(1) - # include JSON data from other files for path in args.include: with open(path, "r") as file: -- 2.30.2