From 7ec90f6b730688f072ec3254987e86c33ec350f0 Mon Sep 17 00:00:00 2001 From: Jannis Leidel Date: Sat, 15 Jun 2013 09:54:46 +0200 Subject: Accept '-' as an output option additional to 'stdout'. --- bvg-grabber.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'bvg-grabber.py') diff --git a/bvg-grabber.py b/bvg-grabber.py index 318aded..fcaf318 100755 --- a/bvg-grabber.py +++ b/bvg-grabber.py @@ -56,10 +56,9 @@ if __name__ == '__main__': query = ActualDepartureQueryApi(args.station) res = query.call() - if args.file == 'stdout': + if args.file in ('stdout', '-'): print(res.to_json, file=sys.stdout) else: file = open(args.file, 'w') print(res.to_json, file=file) file.close() - -- cgit v1.2.3