Skip to content

Commit

Permalink
Add --out option for lobster-report
Browse files Browse the repository at this point in the history
  • Loading branch information
florianschanda committed Jun 20, 2023
1 parent e683405 commit 9fe8a0e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@

### 0.9.6-dev


* `lobster-report` now has an `--out` option, to bring it in line with
the other tools

### 0.9.5

Expand Down
13 changes: 11 additions & 2 deletions lobster/tools/core/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,21 @@ def main():
ap.add_argument("--lobster-config",
metavar="FILE",
default="lobster.conf")
ap.add_argument("--out",
metavar="FILE",
default="report.lobster")

options = ap.parse_args()

if not os.path.isfile(options.lobster_config):
print("error: cannot read config file '%s'" % options.lobster_config)
return 0
return 1

if os.path.exists(options.out) and not os.path.isfile(options.out):
print("error: cannot write to '%s'" % options.out)
print("error: '%s' exists and is not a file" % options.out)
return 1


report = Report()

Expand All @@ -51,7 +60,7 @@ def main():
err.dump()
return 1

report.write_report("report.lobster")
report.write_report(options.out)
return 0


Expand Down

0 comments on commit 9fe8a0e

Please sign in to comment.