# HG changeset patch # User catherine@cordelia # Date 1211707354 14400 # Node ID 5df8e2477ca3e01174417a51495c3a215d59aa9f # Parent f40bb62c625ff0ad95f056932cc6e1a3467d0b86 command-line args working diff -r f40bb62c625f -r 5df8e2477ca3 mysqlpy.py --- a/mysqlpy.py Sun May 25 01:39:25 2008 -0400 +++ b/mysqlpy.py Sun May 25 05:22:34 2008 -0400 @@ -15,10 +15,13 @@ ''' MySqlPy V1.3 - 'sqlplus in python' Author: Luca.Canali@cern.ch -Rev: 1.3.0, 17-Oct-07 +Rev: 1.4.4, 28-May-08 Companion of SqlPython, a python module that reproduces Oracle's command line within python and sqlpyPlus. Major contributions by Catherine Devlin, http://catherinedevlin.blogspot.com + +Usage: sqlpython [connect string] [single-word command] ["multi-word command"]... + Quick start command list: - top -> executes a query to list all active sessions in (Oracle 10g and RAC) @@ -166,9 +169,9 @@ try: if sys.argv[1][0] != '@': my.do_connect(sys.argv.pop(1)) - arg = ' '.join(sys.argv[1:]) - if my.onecmd(arg): - return + for arg in sys.argv[1:]: + if my.onecmd(arg + ';') == my._STOP_AND_EXIT: + return except IndexError: pass my.cmdloop() diff -r f40bb62c625f -r 5df8e2477ca3 sqlpyPlus.py --- a/sqlpyPlus.py Sun May 25 01:39:25 2008 -0400 +++ b/sqlpyPlus.py Sun May 25 05:22:34 2008 -0400 @@ -326,7 +326,6 @@ pipeSeparator = Parser(pyparsing.SkipTo((pyparsing.Literal('|') ^ pyparsing.StringEnd()), include=True), retainSeparator=False) bindScanner = Parser(pyparsing.Literal(':') + pyparsing.Word( pyparsing.alphanums + "_$#" )) -commandSeparator = Parser(pyparsing.SkipTo((pyparsing.Literal(';') ^ pyparsing.StringEnd()), include=True)) def findBinds(target, existingBinds, givenBindVars = {}): result = givenBindVars