Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions bin/cppman
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,12 @@ def main():
sys.exit(0)

if options.keyword:
cm.find(options.keyword)
sys.exit(0)
try:
cm.find(options.keyword)
sys.exit(0)
except RuntimeError as e:
print(e, file=sys.stderr)
sys.exit(16)

if options.source:
if options.source not in config.SOURCES:
Expand Down Expand Up @@ -154,11 +158,11 @@ def main():
sys.stderr.write('What manual page do you want?\n')
sys.exit(1)

keyword = cm.fuzzy_find(args[0])
if not keyword:
sys.exit(1)

try:
keyword = cm.fuzzy_find(args[0])
if not keyword:
sys.exit(1)

pid = cm.man(keyword)
except RuntimeError as e:
print(e, file=sys.stderr)
Expand Down