Closed marcmenem closed 1 year ago
Thanks! My first impression is that this does not really sound like something that users would do often. Additionally, I think that it should not be too difficult to implement the desired behavior as a short shell script instead. What do you think?
tbh, I wouldn't know how to write this shell script, it would probably be quicker to google the command I am looking for...
columns may make the output easier on the eyes but the current impl is actually better for other tools like grep
-ing command names, and/or filtering stuff. Could maybe ig support an additional flag that can switch between pretty-printing (columns) or regular printing (the current one)
Does this Python script solve your problem?
#!/usr/bin/env python3
import subprocess
commands = subprocess.run(
["tldr", "-l"],
capture_output=True,
encoding="utf-8",
).stdout.splitlines()
for command in commands:
output = subprocess.run(
["tldr", command],
capture_output=True,
encoding="utf-8",
).stdout
description = output.lstrip().split("\n\n")[0]
description = " ".join(description.split())
print(f"{command} => {description}")
Looking at the output, I would argue that it is hard to display all of this information in a concise or useful way
Closing because the script seems sufficient (and is mentioned in the manual now) :)
Awesome tool!
I think it would be useful to have two columns in --list with the command and the 1 line description of the command next to it. This would help discovering new commands or remember a command name by grepping a keyword.