comparison lxmldump.py @ 29:f91ef7d7615b

Use store_true feature of argparse.
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 25 May 2021 12:39:04 +0300
parents 3442b8700da7
children 34755af2ea1f
comparison
equal deleted inserted replaced
28:3442b8700da7 29:f91ef7d7615b
246 action="store_const", const=PKK_MODE_XML, 246 action="store_const", const=PKK_MODE_XML,
247 help="output as XML") 247 help="output as XML")
248 248
249 optparser.add_argument("-n", "--normalize", 249 optparser.add_argument("-n", "--normalize",
250 dest="normalize", 250 dest="normalize",
251 action="store_const", const=True, default=False, 251 action="store_true",
252 help="output NFC normalized Unicode") 252 help="output NFC normalized Unicode")
253 253
254 optparser.add_argument("-a", "--annotate", 254 optparser.add_argument("-a", "--annotate",
255 dest="annotate", 255 dest="annotate",
256 action="store_const", const=True, default=False, 256 action="store_true",
257 help="annotate strings") 257 help="annotate strings")
258 258
259 optparser.add_argument("-p", "--debug", 259 optparser.add_argument("-p", "--debug",
260 dest="debug", action="store_const", const=True, default=False, 260 dest="debug",
261 action="store_true",
261 help=argparse.SUPPRESS) 262 help=argparse.SUPPRESS)
262 263
263 optparser.add_argument("-i", "--indent", 264 optparser.add_argument("-i", "--indent",
264 dest="indent", 265 dest="indent",
265 type=int, choices=range(0, 32), default=4, 266 type=int, choices=range(0, 32), default=4,