Skip to content

Commit

Permalink
fix: checkParameters(): add check: --xml* require --xml
Browse files Browse the repository at this point in the history
  • Loading branch information
yzqzss committed Sep 27, 2023
1 parent f32ff3c commit 305378f
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions wikiteam3/dumpgenerator/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,15 @@ def checkParameters(args=argparse.Namespace()) -> bool:
print("ERROR: Don't mix download params and meta info params")
passed = False

if [args.xmlrevisions, args.xmlapiexport, args.xmlrevisions_page].count(True) > 1:
print("ERROR: --xmlrevisions, --xmlapiexport, --xmlrevisions_page are mutually exclusive")
passed = False

if not args.xml:
if args.xmlrevisions or args.xmlapiexport or args.xmlrevisions_page:
print("ERROR: --xmlrevisions, --xmlapiexport, --xmlrevisions_page require --xml")
passed = False

# No download params and no meta info params? Exit
if (not args.xml and not args.images) and (not args.get_wiki_engine):
print("ERROR: Use at least one download param or meta info param")
Expand Down

0 comments on commit 305378f

Please sign in to comment.