Revision 944
Added by Aaron Marcuse-Kubitza almost 13 years ago
map | ||
---|---|---|
28 | 28 |
|
29 | 29 |
env_names = [] |
30 | 30 |
def usage_err(): |
31 |
raise SystemExit('Usage: ' + opts.env_usage(env_names, True) |
|
32 |
+' [commit=1] [test=1] [verbose=1] [debug=1] [profile_to=...] ' |
|
31 |
raise SystemExit('Usage: '+opts.env_usage(env_names, True)+' ' |
|
33 | 32 |
+sys.argv[0]+' [map_path...] [<input] [>output]') |
34 | 33 |
|
35 | 34 |
# Get db config from env vars |
... | ... | |
45 | 44 |
end = util.cast(int, opts.get_env_var('n', None, env_names)) |
46 | 45 |
start = util.cast(int, opts.get_env_var('start', '0', env_names)) |
47 | 46 |
if end != None: end += start |
48 |
test = opts.env_flag('test') |
|
49 |
commit = not test and opts.env_flag('commit') # never commit in test mode |
|
50 |
debug = opts.env_flag('debug') |
|
47 |
test = opts.env_flag('test', env_names) |
|
48 |
commit = not test and opts.env_flag('commit', env_names) |
|
49 |
# never commit in test mode |
|
50 |
debug = opts.env_flag('debug', env_names) |
|
51 | 51 |
sql.run_raw_query.debug = debug |
52 |
verbose = debug or opts.env_flag('verbose') |
|
52 |
verbose = debug or opts.env_flag('verbose', env_names) |
|
53 |
opts.get_env_var('profile_to', None, env_names) # add to env_names |
|
53 | 54 |
|
54 | 55 |
# Logging |
55 | 56 |
def log(msg, on=verbose): |
Also available in: Unified diff
bin/map: Use env_flag()'s new env_names usage support to print flags usage