Skip to content

Commit

Permalink
Improve error handling if a pack isn't given
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBossMagnus committed Dec 13, 2023
1 parent b534a56 commit a61e64c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions MrpackChangelogger.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand All @@ -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)
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")

0 comments on commit a61e64c

Please sign in to comment.