From 12f1282103650cfd84a09b60f0d45ec1723a4304 Mon Sep 17 00:00:00 2001 From: David Vierra Date: Fri, 4 Mar 2011 12:10:55 -1000 Subject: [PATCH] accept -h and --help --- mce.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/mce.py b/mce.py index 37c138e..d772a97 100755 --- a/mce.py +++ b/mce.py @@ -22,8 +22,6 @@ class PlayerNotFound(RuntimeError): pass class mce(object): """ - Usage: - Block commands: {commandPrefix}clone [noair] [nowater] {commandPrefix}fill [ ] @@ -1131,7 +1129,7 @@ class mce(object): def printUsageAndQuit(self): self.printUsage(); - raise UsageError; + raise SystemExit; def loadWorld(self, world): @@ -1158,6 +1156,10 @@ class mce(object): if len(sys.argv): world = sys.argv.pop(0) + + if world.lower() in ("-h", "--help"): + self.printUsageAndQuit() + if len(sys.argv) and sys.argv[0].lower() == "create": #accept the syntax, "mce world3 create" self._create([world]);