diff --git a/wikiteam3/dumpgenerator/cli/cli.py b/wikiteam3/dumpgenerator/cli/cli.py index a2049422..4436ca14 100644 --- a/wikiteam3/dumpgenerator/cli/cli.py +++ b/wikiteam3/dumpgenerator/cli/cli.py @@ -501,19 +501,13 @@ def sleep(self, response=None): # Process namespace exclusions if args.exnamespaces: - # if re.search(r"[^\d, \-]", args.exnamespaces): - if any([not i.isdigit() for i in args.exnamespaces.split(",")]): + try: + exnamespaces = [int(i) for i in ns.split(",")] + except ValueError: print( "Invalid namespace values.\nValid format is integer(s) separated by commas" ) sys.exit(1) - else: - ns = args.exnamespaces.replace(" ", "") - if ns.lower() == "all": - print("You cannot exclude all namespaces.") - sys.exit(1) - else: - exnamespaces = [int(i) for i in ns.split(",")] config = Config(