aboutsummaryrefslogtreecommitdiff
path: root/modpackman.py
diff options
context:
space:
mode:
authorDylan Jones <dylanjones2011@gmail.com>2020-11-27 21:04:58 -0500
committerDylan Jones <dylanjones2011@gmail.com>2020-11-27 21:04:58 -0500
commit912d7359c2c01e459b710a4b6b5c53f1a0fae129 (patch)
treeda86a42085cb0c6a19c7d5daea4e4e7381839022 /modpackman.py
parent48c5159402d4d5a6e0dcf3fac1c56d8a6b99c10d (diff)
downloadmodpackman-912d7359c2c01e459b710a4b6b5c53f1a0fae129.tar.gz
modpackman-912d7359c2c01e459b710a4b6b5c53f1a0fae129.zip
Fix parser ever so slightly
Diffstat (limited to 'modpackman.py')
-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)