فهرست منبع

Allow for filtering against config path

Sometimes we only want to check one specific config at runtime.
nosoop 10 ماه پیش
والد
کامیت
444e59c169
1فایلهای تغییر یافته به همراه6 افزوده شده و 1 حذف شده
  1. 6 1
      src/smgdc/app.py

+ 6 - 1
src/smgdc/app.py

@@ -30,6 +30,7 @@ def main() -> None:
     parser.add_argument(
         "--add-binary", dest="bin_mounts", type=BinaryMountSpec, action="append"
     )
+    parser.add_argument("--match", dest="matches", type=str, action="append")
 
     args = parser.parse_args()
 
@@ -52,11 +53,15 @@ def main() -> None:
         candidate_targets.append(loaded_bin)
 
     for validation_file in sorted(validation_files):
-        header = validation_file.stem
+        header = validation_file.name
         if args.validation_path.is_dir():
             header = str(
                 pathlib.PurePosixPath(validation_file.relative_to(args.validation_path))
             )
+
+        if args.matches and not any(match in header for match in args.matches):
+            continue
+
         print(header)
 
         config = configparser.ConfigParser()