diff --git a/README.md b/README.md index a60cf15..fbbd7a2 100644 --- a/README.md +++ b/README.md @@ -133,7 +133,7 @@ Examples of these are: ### Rule names Obtain the names of the currently implemented rules with: ```bash - amarna --show-rules . + amarna --show-rules ``` ### Rule allowlist diff --git a/amarna/command_line.py b/amarna/command_line.py index 8bf04a7..370a263 100644 --- a/amarna/command_line.py +++ b/amarna/command_line.py @@ -96,6 +96,7 @@ def main() -> int: metavar="-f", type=str, help="the name of the .cairo file or directory with .cairo files to analyze", + nargs="?", ) parser.add_argument("-p", "--print", action="store_true", help="print output") @@ -149,9 +150,17 @@ def main() -> int: filename = args.filename + if filename is None: + print("No file specified") + return -1 + if not os.path.isabs(filename): filename = os.path.join(os.getcwd(), filename) + if not os.path.exists(filename): + print(f"The specified file doesn't exist: {filename}") + return -1 + rule_set_names: List[str] = get_rule_names(args.rules, args.exclude_rules) results: List[Union[Result, ResultMultiplePositions]]