diff options
author | Jannis Leidel <jannis@leidel.info> | 2013-06-15 09:54:46 +0200 |
---|---|---|
committer | Jannis Leidel <jannis@leidel.info> | 2013-06-15 09:54:46 +0200 |
commit | 7ec90f6b730688f072ec3254987e86c33ec350f0 (patch) | |
tree | e6877a171aa494ed65c4107c1527620bf9306d71 | |
parent | cc784751a46441a707c72b72293ee6aa9da143b1 (diff) | |
download | bvg-grabber-7ec90f6b730688f072ec3254987e86c33ec350f0.tar.gz bvg-grabber-7ec90f6b730688f072ec3254987e86c33ec350f0.tar.bz2 bvg-grabber-7ec90f6b730688f072ec3254987e86c33ec350f0.zip |
Accept '-' as an output option additional to 'stdout'.
-rwxr-xr-x | bvg-grabber.py | 3 |
1 files changed, 1 insertions, 2 deletions
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() - |