0

Better error reporting when the wrong number of arguments are used

This commit is contained in:
Andrew Chin
2011-05-08 01:47:40 -04:00
parent a379a731df
commit a289ac2adc

View File

@@ -164,10 +164,18 @@ def main():
logging.error("Invalid world number")
sys.exit(1)
if len(args) != 2:
if len(args) < 2:
if options.delete:
return delete_all(worlddir, None)
parser.error("Where do you want to save the tiles?")
logging.error("Where do you want to save the tiles?")
sys.exit(1)
elif len(args) > 2:
if options.delete:
return delete_all(worlddir, None)
parser.print_help()
logging.error("Sorry, you specified too many arguments")
sys.exit(1)
destdir = args[1]
if options.display_config: