diff --git a/gameshell.py b/gameshell.py index 45c7e51..27dbc12 100644 --- a/gameshell.py +++ b/gameshell.py @@ -73,9 +73,27 @@ class GameShell(Shell): while i < len(args): if args[i] == 'color': i += 1 - if args[i] in ('0', '3', '4', '8', '24'): - self.colorMode = int(args[i]) - i += 1 + if len(args) > i: + if args[i] in ('0', '3', '4', '8', '24'): + self.colorMode = int(args[i]) + i += 1 + else: + print("Valid color depths are 0, 3, 4, 8, and 24.") + else: + print("Valid color depths are 0, 3, 4, 8, and 24.") + elif args[i] == 'automove': + i += 1 + if len(args) > i: + if args[i] in ('on', 'off'): + self.gameBase.autoMove = args[i] == 'on' + i += 1 + else: + print("Valid options are 'on' and 'off'.") + else: + print("Valid options are 'on' and 'off'.") + else: + print("Could not identify option {}".format(args[i])) + i += 1 def __colorTestRoutine(self, lower, upper): colors = []