Skip to content

Commit

Permalink
Change exit code if no entry found (#169)
Browse files Browse the repository at this point in the history
* Return exit code 16 if no entry found

* Write error messages into std.err
  • Loading branch information
KSR-Yasuda authored Jan 29, 2024
1 parent cd457c5 commit b32cdb2
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions bin/cppman
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,8 @@ def main():
try:
pid = cm.man(args[0])
except RuntimeError as e:
print(e)
print(e, file=sys.stderr)
sys.exit(16)
else:
os.waitpid(pid, 0)

Expand All @@ -172,6 +173,6 @@ if __name__ == '__main__':
sys.exit()
except (Exception, KeyboardInterrupt) as e:
if type(e) == KeyboardInterrupt:
print('\nAborted.')
print('\nAborted.', file=sys.stderr)
else:
print('error:', e)
print('error:', e, file=sys.stderr)

0 comments on commit b32cdb2

Please sign in to comment.