Parcourir la source

Allow for filtering against config path

Sometimes we only want to check one specific config at runtime.
nosoop il y a 10 mois
Parent
commit
444e59c169
1 fichiers modifiés avec 6 ajouts et 1 suppressions
  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()