Skip to content

Commit cb09aeb

Browse files
committed
refactor: change -p (--policy) to -e (--existing-policy) for verify-policy command
Signed-off-by: Demolus13 <[email protected]>
1 parent a2203de commit cb09aeb

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/macaron/__main__.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ def verify_policy(verify_policy_args: argparse.Namespace) -> int:
212212

213213
with open(verify_policy_args.file, encoding="utf-8") as file:
214214
policy_content = file.read()
215-
elif verify_policy_args.policy:
215+
elif verify_policy_args.existing_policy:
216216
policy_dir = os.path.join(macaron.MACARON_PATH, "resources", "policies", "datalog")
217217
policy_suffix = ".dl"
218218
template_suffix = f"{policy_suffix}.template"
@@ -221,14 +221,14 @@ def verify_policy(verify_policy_args: argparse.Namespace) -> int:
221221
for policy in os.listdir(policy_dir)
222222
if policy.endswith(template_suffix)
223223
]
224-
if verify_policy_args.policy not in available_policies:
224+
if verify_policy_args.existing_policy not in available_policies:
225225
logger.error(
226226
"The policy %s is not available. Available policies are: %s",
227-
verify_policy_args.policy,
227+
verify_policy_args.existing_policy,
228228
available_policies,
229229
)
230230
return os.EX_USAGE
231-
policy_path = os.path.join(policy_dir, f"{verify_policy_args.policy}{template_suffix}")
231+
policy_path = os.path.join(policy_dir, f"{verify_policy_args.existing_policy}{template_suffix}")
232232
with open(policy_path, encoding="utf-8") as file:
233233
policy_content = file.read()
234234
try:
@@ -602,7 +602,7 @@ def main(argv: list[str] | None = None) -> None:
602602
vp_parser.add_argument("-d", "--database", required=True, type=str, help="Path to the database.")
603603
vp_parser.add_argument("-purl", "--package-url", help="PackageURL for policy template.")
604604
vp_group.add_argument("-f", "--file", type=str, help="Path to the Datalog policy.")
605-
vp_group.add_argument("-p", "--policy", help="Example policy to run.")
605+
vp_group.add_argument("-e", "--existing-policy", help="Name of the existing policy to run.")
606606
vp_group.add_argument("-s", "--show-prelude", action="store_true", help="Show policy prelude.")
607607

608608
# Find the repo and commit of a passed PURL, or the commit of a passed PURL and repo.

0 commit comments

Comments
 (0)