tldr-pages / tldr-c-client

C command-line client for tldr pages
MIT License
296 stars 49 forks source link

Feature Request: show the Man page when there is no TLDR page #25

Closed snoblenet closed 6 years ago

snoblenet commented 6 years ago

At present, when there is no matching TLDR page, the client asks you submit one.

That's great, and should continue, but it might be an idea to also automatically show the Man page at that point.

Paspartout commented 6 years ago

You can write a simple script or shell function to do just that:

tldman() {
        tldr $1 || man $1
}
snoblenet commented 6 years ago

Thanks. I settled on:

help() {
  echo "$(tldr $1) \n $(man $1)" | less -R
}

If I come across any other similar tools (e.g. something that provides a link to the tool in question's repo, etc) then I'll add them to the function too.