🐛 bugfix: cannot pipe output into program

canged the logfile paramater from a positional argument to an option
This commit is contained in:
Marc Koch 2022-10-29 16:41:25 +02:00
parent acdf4f637f
commit cd1fbcb332
Signed by: marc
GPG Key ID: 12406554CFB028B9
1 changed files with 3 additions and 2 deletions

View File

@ -11,13 +11,14 @@ CLOSING_LINE_RE = r"^\)$"
# Setup argparse # Setup argparse
argparser = argparse.ArgumentParser( argparser = argparse.ArgumentParser(
description='Translate a CiviProxy logfile into JSON format. ') description='Translate a CiviProxy logfile into JSON format. ')
argparser.add_argument('logfile', argparser.add_argument('-f',
'--logfile',
help='CiviProxy logfile', help='CiviProxy logfile',
type=argparse.FileType('r', encoding='UTF-8'), type=argparse.FileType('r', encoding='UTF-8'),
default=(None if sys.stdin.isatty() else sys.stdin)) default=(None if sys.stdin.isatty() else sys.stdin))
argparser.add_argument('-i', argparser.add_argument('-i',
'--indent', '--indent',
help='Print JSON with indent', help='number of spaces to indent JSON output',
type=int, type=int,
default=4) default=4)