synix/pkgs/pyman/pyman
sid 95a533c876
All checks were successful
Deploy docs / build-and-deploy (push) Successful in 3s
initial commit
2026-02-23 20:34:35 +01:00

26 lines
540 B
Python

#!/usr/bin/env python3
import sys
import io
def main():
if len(sys.argv) != 2:
print(f"Usage: {sys.argv[0]} <topic>")
sys.exit(1)
topic = sys.argv[1]
# Capture the output of the help function
captured_output = io.StringIO()
sys.stdout = captured_output
try:
help(topic)
except Exception as e:
print(f"Error: {e}")
finally:
sys.stdout = sys.__stdout__
# Print the captured output
print(captured_output.getvalue())
if __name__ == "__main__":
main()