Skip to content

Commit

Permalink
Change arg parser to allow multiple sequential transformations.
Browse files Browse the repository at this point in the history
  • Loading branch information
namcsi committed Jan 28, 2024
1 parent 0a8fc31 commit 2ef8900
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 4 additions & 3 deletions src/renopro/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ def main():
rast.add_reified_files(args.infiles)
elif args.input_format == "reflected":
rast.reify_files(args.infiles)
rast.transform(
meta_files=args.meta_encoding, clingo_options=args.clingo_options
)
for meta_encoding in args.meta_encodings:
rast.transform(
meta_files=meta_encoding, clingo_options=args.clingo_options
)
if args.output_format == "reified":
print(rast.reified_string)
elif args.output_format == "reflected":
Expand Down
5 changes: 3 additions & 2 deletions src/renopro/utils/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,11 +92,12 @@ def get(levels: list[tuple[str, int]], name: Any) -> Optional[Any]:
parents=[common_arg_parser],
)
transform_parser.add_argument(
"--meta-encoding",
"--meta-encodings",
"-m",
action="append",
nargs="+",
type=Path,
help="Meta-encoding to be applied to reified facts.",
help="Meta-encodings to be applied to reified facts.",
required=True,
)
transform_parser.add_argument(
Expand Down

0 comments on commit 2ef8900

Please sign in to comment.