0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00
This commit is contained in:
“digitalist.ru” 2016-05-15 01:02:46 +03:00
parent de2409dd7e
commit e80f06e2a3

View File

@ -84,12 +84,25 @@ def usage(optionalArgs = {}):
def help_message(): def help_message():
arg_string = '\n' arg_string = '\n'
pad = 0
padding = 0
for argument in list(optionalArgs.keys()):
if len(argument) > pad:
pad = len(argument)
for argument in list(optionalArgs.keys()): for argument in list(optionalArgs.keys()):
if argument == '-help': if argument == '-help':
continue continue
arg_string = arg_string + ' [-[no]'+argument+'] ' + optionalArgs[argument] + '\n' if len(argument) < pad:
print('Usage: ddl2cpp [-help] ' + arg_string + padding = " " * (pad - len(argument))
' <path to ddl> <path to target (without extension, e.g. /tmp/MyTable)> <namespace>') else:
padding = ''
arg_string = arg_string + ' [-[no]'+argument+']: ' + padding + optionalArgs[argument] + '\n'
print('Usage: ddl2cpp [-help]\n\n OPTIONAL ARUMENTS:\n' + arg_string +' \n \
<path to ddl> <path to target> <namespace>\n\
\n\
<path to ddl> path to your SQL database/table definitions (SHOW CREATE TABLE SomeTable) \n\
<path to target> path to a generated C++ header file. Without extension (no *.h). \n\
<namespace> namespace you want. Usually a project/database name\n')
sys.exit(0) sys.exit(0)
optionalArgs = { optionalArgs = {