Use derdump without colored module and still present usage errors
authorRick van Rein <rick@openfortress.nl>
Fri, 1 Mar 2019 08:32:23 +0000 (09:32 +0100)
committerRick van Rein <rick@openfortress.nl>
Fri, 1 Mar 2019 08:32:23 +0000 (09:32 +0100)
derdump

diff --git a/derdump b/derdump
index 8ddd3f3..475d214 100755 (executable)
--- a/derdump
+++ b/derdump
@@ -10,11 +10,6 @@ opts.add_option ('-c', '--colour', '--color',
                help='Print colourful output (loads Python module "colored", page with "less -R")')
 (options,args) = opts.parse_args ()
 
-if len (args) != 1:
-       print 'Usage:  ' + attr ('bold') + sys.argv [0] + '[--colour] file.der' + attr (0)
-       print 'Output: ' + nicemeaning ('MEANING') + ': ' + nicetag ('TAG') + ' ' + nicecontlen ('CONTLEN', 3) + ' ' + nicetagofs ('TAGOFS') + ' ' + nicenesting ('NESTING') + ', ' + niceclass ('CLASS') + ', ' + niceprimconstr ('PRIMCONSTR')
-       sys.exit (1)
-
 if options.colour:
        from colored import fg, bg, attr
 else:
@@ -23,6 +18,11 @@ else:
        fg = attr
        bg = attr
 
+if len (args) != 1:
+       print 'Usage:  ' + attr ('bold') + sys.argv [0] + '[--colour] file.der' + attr (0)
+       print 'Output: ' + nicemeaning ('MEANING') + ': ' + nicetag ('TAG') + ' ' + nicecontlen ('CONTLEN', 3) + ' ' + nicetagofs ('TAGOFS') + ' ' + nicenesting ('NESTING') + ', ' + niceclass ('CLASS') + ', ' + niceprimconstr ('PRIMCONSTR')
+       sys.exit (1)
+
 
 class2str = {
        0: 'Universal',