aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xmodpackman.py11
1 files changed, 4 insertions, 7 deletions
diff --git a/modpackman.py b/modpackman.py
index e5c355d..50c50d2 100755
--- a/modpackman.py
+++ b/modpackman.py
@@ -41,8 +41,6 @@ parser.add_argument("--game-version",
default=None,
help="The maximum game version to update mods to")
-COMMAND_MAP = ["install", "apply_updates", "check_updates"]
-
if __name__ == "__main__":
args = parser.parse_args()
config = util.load_config()
@@ -71,11 +69,6 @@ if __name__ == "__main__":
if args.game_version:
GAME_VERSION = util.game_version_from_string(args.game_version)
- if not (args.command in COMMAND_MAP):
- print("Error: command \"" + args.command + "\" does not exist")
- parser.print_help()
- sys.exit(1)
-
# run the command
if args.command == "install":
util.install(args.version_file, args.whitelist_file, pack['location'])
@@ -83,3 +76,7 @@ if __name__ == "__main__":
util.apply_updates(mods, args.version_file, GAME_VERSION)
elif args.command == "check_updates":
util.check_updates(mods, args.version_file, GAME_VERSION)
+ else:
+ print("Error: command \"" + args.command + "\" does not exist")
+ parser.print_help()
+ sys.exit(1)