Update of /cvsroot/modeling/ProjectModeling/Modeling/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29228/Modeling/scripts
Modified Files:
mdl_generate_DB_schema.py
Log Message:
Fixed bug #902209: mdl_generate_DB_schema.py silently exiting when no command supplied
Index: mdl_generate_DB_schema.py
===================================================================
RCS file: /cvsroot/modeling/ProjectModeling/Modeling/scripts/mdl_generate_DB_schema.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** mdl_generate_DB_schema.py 14 Feb 2004 17:59:32 -0000 1.9
--- mdl_generate_DB_schema.py 22 Feb 2004 18:50:48 -0000 1.10
***************
*** 117,121 ****
def usage(prgName):
_usage="""
! %s [options] model.(xml|py)
Generates and/or executes the SQL code from a model, either an xml file or a
--- 117,121 ----
def usage(prgName):
_usage="""
! %s [options] command(s) model.(xml|py)
Generates and/or executes the SQL code from a model, either an xml file or a
***************
*** 131,138 ****
-i --ignore-errors ignore errors (default is halt on error)
! DB-schema generation
! --------------------
! Most commonly used options:
-A --all-but-database Drops and recreate everything except the database
--- 131,138 ----
-i --ignore-errors ignore errors (default is halt on error)
! Commands for DB-schema generation
! ---------------------------------
! Most commonly used commands:
-A --all-but-database Drops and recreate everything except the database
***************
*** 147,151 ****
Last two options require '--admin-dsn' to be set as well (see below)
! Additionally, the following options are available:
-D drop database (requires --admin-dsn)
--- 147,151 ----
Last two options require '--admin-dsn' to be set as well (see below)
! Additionally, the following commands are available:
-D drop database (requires --admin-dsn)
***************
*** 161,166 ****
-F create foreign key constraints
! Note: each of the 3 options -A -C and -R (and their corresponding long
! options) discard any other options that appear before.
Example: '-D -C' is equivalent to '-C', and '-C -D' is equivalent to '-R'
--- 161,166 ----
-F create foreign key constraints
! Note: each of the 3 commands -A -C and -R (and their corresponding long
! options) discard any other commands that appear before.
Example: '-D -C' is equivalent to '-C', and '-C -D' is equivalent to '-R'
***************
*** 326,329 ****
--- 326,334 ----
if len(args)!=1: usage(me) ; return 1
+ import operator
+ if not reduce(operator.add, generation_options.values()):
+ sys.stderr.write('Error: no command given, see --help for details\n')
+ return 1
+
model_file=args[0]
# load the model
|