comparison doc/check-seclevel.py @ 27510:020d93c4a727

check-seclevel: add a --debug option This will make it possible to get semi-meaningful tracebacks if an import error occurs. Why care? Trying to run this script under pypy currently fails, but the true error is obscured.
author Bryan O'Sullivan <bos@serpentine.com>
date Tue, 22 Dec 2015 21:38:05 -0800
parents ab776610fc6d
children 44a596a8bed1
comparison
equal deleted inserted replaced
27509:6ff90d618d72 27510:020d93c4a727
125 option. 125 option.
126 """) 126 """)
127 optparser.add_option("-v", "--verbose", 127 optparser.add_option("-v", "--verbose",
128 help="enable additional output", 128 help="enable additional output",
129 action="store_true") 129 action="store_true")
130 optparser.add_option("-d", "--debug",
131 help="debug mode",
132 action="store_true")
130 optparser.add_option("-f", "--file", 133 optparser.add_option("-f", "--file",
131 help="filename to read in (or '-' for stdin)", 134 help="filename to read in (or '-' for stdin)",
132 action="store", default="") 135 action="store", default="")
133 136
134 optparser.add_option("-t", "--topic", 137 optparser.add_option("-t", "--topic",
150 153
151 (options, args) = optparser.parse_args() 154 (options, args) = optparser.parse_args()
152 155
153 ui = uimod.ui() 156 ui = uimod.ui()
154 ui.setconfig('ui', 'verbose', options.verbose, '--verbose') 157 ui.setconfig('ui', 'verbose', options.verbose, '--verbose')
158 ui.setconfig('ui', 'debug', options.debug, '--debug')
155 159
156 if options.file: 160 if options.file:
157 if checkfile(ui, options.file, options.initlevel): 161 if checkfile(ui, options.file, options.initlevel):
158 sys.exit(1) 162 sys.exit(1)
159 else: 163 else: