dbrgn / tealdeer

A very fast implementation of tldr in Rust.
https://dbrgn.github.io/tealdeer/
Apache License 2.0
4.06k stars 123 forks source link

Add a random flag like node client #340

Closed MustCodeAl closed 11 months ago

MustCodeAl commented 11 months ago

it would be nice to see a random tldr every time terminal is opened to help with command line learning and configurable number of commands to show for that tldr page.

tldr --random

  page: tar

  Archiving utility.
  Often combined with a compression method, such as gzip or bzip2.
  More information: https://www.gnu.org/software/tar.

  - [c]reate an archive and write it to a [f]ile:
    tar cf path/to/target.tar path/to/file1 path/to/file2 ...

  - [c]reate a g[z]ipped archive and write it to a [f]ile:
    tar czf path/to/target.tar.gz path/to/file1 path/to/file2 ...
MustCodeAl commented 11 months ago

now i have added changes

niklasmohrin commented 11 months ago

I am not sure if I like this being its own flag of tealdeer, when the same behavior can already be achieved in one shell command, for example in bash: tldr -q $(tldr -q --list | shuf -n1). We could however write this down as an example somewhere in the documentation as a nice idea. What do you think?

MustCodeAl commented 11 months ago

i had no idea of that command existing 😅, that would be cool

dbrgn commented 11 months ago

I agree, I don't think a "random" command belongs in tealdeer, since this can be achieved with external tools.

I think the use case is a bit obscure, but it wouldn't hurt to add a "Tips & Tricks" section to the docs.