From cd1fbcb33280a6cb162a2466495ec877434b86f6 Mon Sep 17 00:00:00 2001 From: Marc Michalsky Date: Sat, 29 Oct 2022 16:41:25 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20bugfix:=20cannot=20pipe=20output?= =?UTF-8?q?=20into=20program?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit canged the logfile paramater from a positional argument to an option --- civiproxy_logs2json/__main__.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/civiproxy_logs2json/__main__.py b/civiproxy_logs2json/__main__.py index ce19f2d..8e8ae59 100644 --- a/civiproxy_logs2json/__main__.py +++ b/civiproxy_logs2json/__main__.py @@ -11,13 +11,14 @@ CLOSING_LINE_RE = r"^\)$" # Setup argparse argparser = argparse.ArgumentParser( description='Translate a CiviProxy logfile into JSON format. ') -argparser.add_argument('logfile', +argparser.add_argument('-f', + '--logfile', help='CiviProxy logfile', type=argparse.FileType('r', encoding='UTF-8'), default=(None if sys.stdin.isatty() else sys.stdin)) argparser.add_argument('-i', '--indent', - help='Print JSON with indent', + help='number of spaces to indent JSON output', type=int, default=4)