summaryrefslogtreecommitdiff
path: root/umlpy.py
diff options
context:
space:
mode:
Diffstat (limited to 'umlpy.py')
-rwxr-xr-xumlpy.py19
1 files changed, 14 insertions, 5 deletions
diff --git a/umlpy.py b/umlpy.py
index 3ac4436..20688c1 100755
--- a/umlpy.py
+++ b/umlpy.py
@@ -38,26 +38,27 @@ import re
from optparse import OptionParser
-parser = OptionParser ()
+usage = "usage: %prog [options] module ..."
+parser = OptionParser (usage = usage)
parser.add_option("-v", dest = "debug", action = "store_true",
default = False,
help = "enables debug output")
parser.add_option("-e", "--exclude", dest = "excludes", action = "append",
default = [],
help = "classes matching this regexp will be excluded \
- from display")
+from display")
parser.add_option("-i", "--include", dest = "includes", action = "append",
default = [],
help = "classes matching this regexp will be included \
- in display even if they were excluded by exclude \
- regexps")
+in display even if they were excluded by exclude \
+regexps")
parser.add_option("-p", "--prefix", dest = "prefix", action = "store",
default = "",
help = "prefix which will be stripped of class names")
parser.add_option("-f", "--force", dest = "forces", action = "append",
default = [],
help = "classes matching this regexp will be forced into \
- display")
+display")
parser.add_option("--all-methods", dest = "all_methods",
action = "store_true", default = False,
help = "shows all methods")
@@ -497,4 +498,12 @@ class UmlPy (object):
if __name__ == "__main__":
(options, args) = parser.parse_args ()
+ if not args:
+ parser.error ("please specify at least one module")
+ if options.all_methods and options.no_method:
+ parser.error ("options --all-methods and --no-method are \
+mutually exclusive")
+ if options.all_properties and options.no_property:
+ parser.error ("options --all-properties and --no-property are \
+mutually exclusive")
UmlPy (args, options)