# HG changeset patch # User catherine@dellzilla # Date 1264190660 18000 # Node ID 146d64d2ad5e302e840f541bc68950e4d3364495 # Parent e728bf6336df4cbeb1f42009b2a924bdec043658 beginning to explore use of Gerald Users diff -r e728bf6336df -r 146d64d2ad5e sqlpython/sqlpython.py --- 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: