Skip to content

Commit

Permalink
fix exit codes in cli
Browse files Browse the repository at this point in the history
  • Loading branch information
olf42 committed Apr 26, 2018
1 parent 2436101 commit c3ff829
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pit/tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,16 @@ def cli(agent, filepath, add, desc, activity, origin, sources, browser, namespac
if not os.path.isfile(filepath):
if os.path.isdir(filepath):
print("Filepath must point to a file, not a directory.")
sys.exit(1)
else:
print("Invalid filepath.")
return
sys.exit(2)

if not add:
prov = load_prov(filepath, namespace=namespace)
if not prov:
print("No provenance Information available")
return
sys.exit(0)

elif add:
prov = Provenance(filepath, namespace=namespace)
Expand Down

0 comments on commit c3ff829

Please sign in to comment.