changeset 423:146d64d2ad5e

beginning to explore use of Gerald Users
author catherine@dellzilla
date Fri, 22 Jan 2010 15:04:20 -0500
parents e728bf6336df
children 34607fdba3eb
files sqlpython/sqlpython.py
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/sqlpython/sqlpython.py	Fri Dec 04 09:40:40 2009 -0500
+++ b/sqlpython/sqlpython.py	Fri Jan 22 15:04:20 2010 -0500
@@ -126,8 +126,8 @@
                             pyparsing.Optional(pyparsing.CaselessKeyword('as') + 
                                                (pyparsing.CaselessKeyword('sysoper') ^ 
                                                 pyparsing.CaselessKeyword('sysdba'))('mode')))
-    postgresql_connect_parser = (legal_sql_word('db_name') + 
-                                 pyparsing.Optional(legal_sql_word('username')))
+    postgresql_connect_parser = pyparsing.Optional(legal_sql_word('db_name') + 
+                                                   pyparsing.Optional(legal_sql_word('username')))
           
     def connect_url(self, arg, opts):               
         if opts.oracle:
@@ -184,7 +184,7 @@
                                     help='close connection {N} (or current)'),
                    cmd2.make_option('-C', '--closeall', action='store_true', 
                                     help='close all connections'),
-                   cmd2.make_option('--postgres', action='store_true', help='Connect to a postgreSQL database'),
+                   cmd2.make_option('--postgres', action='store_true', help='Connect to postgreSQL: `sqlpython --postgres [DBNAME [USERNAME]]`'),
                    cmd2.make_option('--oracle', action='store_true', help='Connect to an Oracle database'),
                    cmd2.make_option('--mysql', action='store_true', help='Connect to a MySQL database'),                   
                    cmd2.make_option('-r', '--rdbms', type='string', 
@@ -209,7 +209,7 @@
                 arg = self.connection_number
             self.disconnect(arg)
             return 
-        if not arg:
+        if (not arg) and (not opts.postgres):
             self.list_connections()
             return 
         try: