Skip to content

Commit

Permalink
renamed --show to --show-facts
Browse files Browse the repository at this point in the history
  • Loading branch information
nrueh committed Dec 3, 2024
1 parent f5d1738 commit 6ca2893
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ coomsuite solve examples/coom/kids-bike.coom 0 -q
- Note that the direct conversion of COOM into facts is a mere serialization of
the COOM model. We make use of a preprocessing encoding to translate the
"serialized" facts into a set of "refined" facts, capturing the essence of a
configuration problem. To show the "refined" facts, run with option `--show`.
This will print the facts to the console.
configuration problem. To show the "refined" facts, run with option
`--show-facts`. This will print the facts to the console.

### Extending the workbench

Expand Down
4 changes: 2 additions & 2 deletions src/coomsuite/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,10 @@ def main():
+ unknown_args
)

if args.show:
if args.show_facts:
options.append("--outf=3")

clingo_main(COOMApp(solver=args.solver, output=args.output, show=args.show), options)
clingo_main(COOMApp(solver=args.solver, output=args.output, show_facts=args.show_facts), options)


if __name__ == "__main__":
Expand Down
8 changes: 4 additions & 4 deletions src/coomsuite/application.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class COOMApp(Application):

_solver: str
_output: str
_show: bool
_show_facts: bool
_istest: bool
_log_level: str
config: FclingoConfig
Expand All @@ -71,15 +71,15 @@ def __init__(
log_level: str = "",
solver: str = "",
output: str = "",
show: bool = False,
show_facts: bool = False,
istest: bool = False,
):
"""
Create application.
"""
self._solver = "clingo" if solver == "" else solver
self._output = "asp" if output == "" else output
self._show = show
self._show_facts = show_facts
self._istest = istest
self._log_level = "WARNING" if log_level == "" else log_level
self.config = FclingoConfig(MIN_INT, MAX_INT, Flag(False), Flag(False), DEF)
Expand Down Expand Up @@ -215,7 +215,7 @@ def main(self, control: Control, files: Sequence[str]) -> None:
Main function ran on call.
"""
processed_facts = self.preprocess(list(files))
if self._show:
if self._show_facts:
print("\n".join(processed_facts)) # nocoverage
else:
user_input_check = self.check_user_input(processed_facts)
Expand Down
2 changes: 1 addition & 1 deletion src/coomsuite/utils/parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,5 +99,5 @@ def get(levels: list[tuple[str, int]], name: str) -> Optional[int]:
parser_solve.add_argument(
"--output", "-o", type=str, help="Set console output format", choices=["asp", "coom"], default="asp"
)
parser_solve.add_argument("--show", action="store_true", help="Show preprocessed fact format")
parser_solve.add_argument("--show-facts", action="store_true", help="Show preprocessed fact format")
return parser

0 comments on commit 6ca2893

Please sign in to comment.