0
0
mirror of https://github.com/rbock/sqlpp11.git synced 2024-11-15 20:31:16 +08:00

small cleanup, pre-merging

This commit is contained in:
strangeqargo 2016-05-14 15:57:26 +03:00
parent dad441f2b9
commit 11f40dc20c

View File

@ -78,13 +78,14 @@ def usage(optionalArgs = {}):
Usage: ddl2cpp <path to ddl> <path to target (without extension, e.g. /tmp/MyTable)> <namespace>\n\ Usage: ddl2cpp <path to ddl> <path to target (without extension, e.g. /tmp/MyTable)> <namespace>\n\
ddl2cpp -help') ddl2cpp -help')
def help():
argString = '\n' def help_message():
for arg in list(optionalArgs.keys()): arg_string = '\n'
if arg == '-help': for argument in list(optionalArgs.keys()):
if argument == '-help':
continue continue
argString = argString + ' [-[no]'+arg+'] ' + optionalArgs[arg] + '\n' arg_string = arg_string + ' [-[no]'+argument+'] ' + optionalArgs[argument] + '\n'
print('Usage: ddl2cpp [-help] ' + argString + ' <path to ddl> <path to target (without extension, e.g. /tmp/MyTable)> <namespace>') print('Usage: ddl2cpp [-help] ' + arg_string + ' <path to ddl> <path to target (without extension, e.g. /tmp/MyTable)> <namespace>')
sys.exit(0) sys.exit(0)
optionalArgs = { optionalArgs = {
@ -97,8 +98,8 @@ optionalArgs = {
'-help': "show this help" '-help': "show this help"
} }
if ('-help') in sys.argv: if '-help' in sys.argv:
help() help_message()
# ARGUMENT PARSING # ARGUMENT PARSING
if len(sys.argv) < (4): if len(sys.argv) < (4):
usage(optionalArgs) usage(optionalArgs)