commit 68b6cdea38578c7924bc937c6fb3da25de0e6fb2
parent c24979dbacf316beb48a99b7fffcc6344ad2098b
Author: Sam Kingston <sam@sjkwi.com.au>
Date: Sun, 10 Oct 2010 19:04:13 +1000
write default config to stdout if command-line argument is given
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/constance.py b/constance.py
@@ -46,9 +46,15 @@ def main():
# set up argument parser
parser = optparse.OptionParser()
parser.add_option('--config', metavar='FILENAME')
+ parser.add_option('--dump-default-config', action='store_true')
parser.set_defaults(config=config_filename)
+ parser.set_defaults(dump_default_config=False)
options, args = parser.parse_args()
+ if options.dump_default_config:
+ print default_config
+ return
+
# populate config from default location (which would have been
# overidden by --config above, if given)
config = SafeConfigParser(allow_no_value=True)