From a61e64c6469b31678abb4afc89e609def4aa7d4c Mon Sep 17 00:00:00 2001 From: TheBossMagnus Date: Wed, 13 Dec 2023 19:39:55 +0100 Subject: [PATCH] Improve error handling if a pack isn't given --- MrpackChangelogger.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MrpackChangelogger.py b/MrpackChangelogger.py index f78c4ac..1f04c06 100644 --- a/MrpackChangelogger.py +++ b/MrpackChangelogger.py @@ -31,8 +31,8 @@ def parse_arguments(): parser.add_argument("-o", "--old", help="The pack to compare to") parser.add_argument("-n", "--new", help="The pack to compare") parser.add_argument("-c", "--config", nargs='?', const='new', help="Choose or create a config file") - parser.add_argument("-d", "--debug", action="store_true", help="Enable debug logging") parser.add_argument("-f", "--file", help="Specify the output file") + parser.add_argument("-d", "--debug", action="store_true", help="Enable debug logging") return parser.parse_args() def main(old_path, new_path, config_path=None, output_file=None): @@ -57,4 +57,8 @@ def main(old_path, new_path, config_path=None, output_file=None): args.config = None create_config() if args.old and args.new: - main(args.old, args.new, args.config, args.file) \ No newline at end of file + main(args.old, args.new, args.config, args.file) + elif args.old: + logger.error("No new pack specified") + elif args.new: + logger.error("No old pack specified") \ No newline at end of file