diff --git a/amarna/command_line.py b/amarna/command_line.py index 3920c13..e1ed6bc 100644 --- a/amarna/command_line.py +++ b/amarna/command_line.py @@ -96,7 +96,7 @@ def main() -> int: metavar="-f", type=str, help="the name of the .cairo file or directory with .cairo files to analyze", - nargs="?" + nargs="?", ) parser.add_argument("-p", "--print", action="store_true", help="print output") @@ -150,9 +150,12 @@ def main() -> int: filename = args.filename - if not os.path.isabs(filename): + if filename is not None and not os.path.isabs(filename): filename = os.path.join(os.getcwd(), filename) + if not os.path.exists(filename): + raise Exception("The specified file doesn't exist") + rule_set_names: List[str] = get_rule_names(args.rules, args.exclude_rules) results: List[Union[Result, ResultMultiplePositions]]