Commits

Benjamin Althues committed 2f87250

On Windows, when executed without arguments, run GUI()

Comments (0)

Files changed (2)

 .. -*- restructuredtext -*-
 
-==================
-User documentation
-==================
+==============
+DisPass README
+==============
+:Author: Benjamin Althues
+:Copyright: Copyright 2011, Benjamin Althues.
+:Revision: 2
+:Date: 2011/05/17
+
 DisPass is a passphrase generator for Windows and Unix / Linux.
 You can use it to create unique passwords for logging in to websites, servers
 or any other kind of thing that requires login. 
    This is a master password that, together with the label is used to generate 
    the passphrase.
 
------------
-Downloading
------------
+
+-------------------
+Downloading DisPass
+-------------------
 DisPass is distributed in three flavors:
 
  1. The complete package with the DisPass python module, setup and 
 
    No info yet.
 
+
 --------------------
 Installing (Windows)
 --------------------
 No info yet.
 
+
 ---------------------------------------
 Using the command line app (Unix/Linux)
 ---------------------------------------
 Usage::
 
-   DisPass 0.1a6  - http://babab.nl/p/dispass
+   DisPass 0.1a6(posix) - http://babab.nl/p/dispass
+
+   When DisPass is executed as 'gdispass' or 'dispass -g',
+   the graphical version will be started.
 
    USAGE: dispass [-co] label [label2] [label3] [...]
           dispass -g | -h | -V
           gdispass
 
-   -c, --create    use if this passphrase is new (2x password check)
+   Options:
+   -c, --create    use if this passphrase is new (check input PW)
    -g, --gui       start guided graphical version of DisPass
    -h, --help      show this help and exit
    -o, --output    output passphrases to stdout (instead of the 
                    more secure way of displaying via curses)
    -V, --version   show full version information and exit
 
+
 ------------------------------------
 Using the command line app (Windows)
 ------------------------------------
-No info yet.
+Usage::
+
+   DisPass 0.1a6(nt) - http://babab.nl/p/dispass
+
+   When DisPass is started without arguments, the graphical
+   version will be started. To use the command line,
+   submit one or more labels.
+
+   USAGE: dispass [options] [label] [label2] [label3] [...]
+
+   Options:
+   -c, --create    use if this passphrase is new (check input PW)
+   -h, --help      show this help and exit
+   -V, --version   show full version information and exit
+
 
 ---------------------------
 Using the graphical version
 import getopt
 import getpass
 import hashlib
+import os
 import re
 import sys
 
     return str(r)
 
 def usage():
-    print versionStr, ' - http://babab.nl/p/dispass'
-    print
-    print 'USAGE: dispass [-co] label [label2] [label3] [...]'
-    print '       dispass -g | -h | -V'
-    print '       gdispass'
-    print 
-    print '-c, --create    use if this passphrase is new (2x password check)'
-    print '-g, --gui       start guided graphical version of DisPass'
-    print '-h, --help      show this help and exit'
-    print '-o, --output    output passphrases to stdout (instead of the '
-    print '                more secure way of displaying via curses)'
-    print '-V, --version   show full version information and exit'
+    if os.name == 'nt':
+        print "%s(nt) - http://babab.nl/p/dispass" % versionStr
+        print
+        print 'When DisPass is started without arguments, the graphical'
+        print 'version will be started. To use the command line,'
+        print 'submit one or more labels.'
+        print 
+        print 'USAGE: dispass [options] [label] [label2] [label3] [...]'
+        print 
+        print 'Options:'
+        print '-c, --create    use if this passphrase is new (check input PW)'
+        print '-h, --help      show this help and exit'
+        print '-V, --version   show full version information and exit'
+    else:
+        print "%s(%s) - http://babab.nl/p/dispass" % (versionStr, os.name)
+        print 
+        print "When DisPass is executed as 'gdispass' or 'dispass -g',"
+        print 'the graphical version will be started.'
+        print
+        print 'USAGE: dispass [-co] label [label2] [label3] [...]'
+        print '       dispass -g | -h | -V'
+        print '       gdispass'
+        print 
+        print 'Options:'
+        print '-c, --create    use if this passphrase is new (check input PW)'
+        print '-g, --gui       start guided graphical version of DisPass'
+        print '-h, --help      show this help and exit'
+        print '-o, --output    output passphrases to stdout (instead of the '
+        print '                more secure way of displaying via curses)'
+        print '-V, --version   show full version information and exit'
 
 def main(argv):
     try:
             usage()
             sys.exit()
         elif o in ("-V", "--version"):
-            print versionStr, ' - ', __version_info__
+            print versionStr, '-', __version_info__, 'running on', os.name
             sys.exit()
         else:
             assert False, "unhandled option"
     if labels:
         CLI(labels, pwTypoCheck, settings.useCurses)
     else:
-        usage()
+        if os.name == 'nt':
+            usage()
+            print '-' * 78
+            print 'Starting GUI...'
+            GUI()
+        else:
+            usage()
 
 if __name__ == '__main__':
     main(sys.argv)