🐛 bugfix: cannot pipe output into program
canged the logfile paramater from a positional argument to an option
This commit is contained in:
parent
acdf4f637f
commit
cd1fbcb332
|
|
@ -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)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue