Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tldr should not return 0 when a TLDR page is not found #4227

Closed
letompouce opened this issue Jul 24, 2020 · 4 comments · Fixed by #4246
Closed

tldr should not return 0 when a TLDR page is not found #4227

letompouce opened this issue Jul 24, 2020 · 4 comments · Fixed by #4246

Comments

@letompouce
Copy link

Description

When tldr doesn't find a TLDR page, it should not return 0.

Steps to reproduce

Feed tldr with a trainspotting-powered argument, observe its return code.

Expected result

tldr does not return 0

Actual restult

tldr return 0 whatever you feed it with.

Example

$ tldr Choose a life. Choose a job. Choose a career. Choose a family.  2> /dev/null && echo true          
true

Why would this been addressed

For instance, when a page is not found in your $LANG language, this would allow to fallback to en (which supposedly has more references, being the default language) , such as:

tldr ss || tldr --language en ss

Actual result

$ tldr ss || tldr --language en ss
`ss` documentation is not available. Consider contributing Pull Request to https://github.com/tldr-pages/tldr

Expected result

$ tldr ss || tldr --language en ss

  ss

  Utility to investigate sockets.
[...]
@letompouce letompouce changed the title tldr should not return 0 when a tlDR page is not found tldr should not return 0 when a TLDR page is not found Jul 24, 2020
@sbrl
Copy link
Member

sbrl commented Jul 26, 2020

Hey there, @letompouce! Thanks for the report. Indeed, that does sound like a bug - I agree the exit code should reflect whether it finds a page or not. This makes it easier to drive via a script - and indeed my tldr-missing-pages script relies on it.

However, this is a client-specific feature, and this repository is just for the pages themselves. Do you know which client you're using (or perhaps how you installed it)? I can direct you to the correct repository to report this if you are unsure :-)

@samuel-w
Copy link
Contributor

samuel-w commented Aug 3, 2020

Judging by the syntax of the error message, the client is tldr-python-client, which is fixed by tldr-pages/tldr-python-client#129

@sbrl
Copy link
Member

sbrl commented Aug 9, 2020

Thanks, @samuel-w ❤️

We've also got #4246 open against the spec to improve that too. Once that PR is merged, we can close this issue I think.

@letompouce
Copy link
Author

Hi,

Sorry for the delay, summertime and brain meltdown!

That was both: Haskell client from the Debian Buster package (0.4.0-2+b2 at the time) ; and the python client (1.0.0 from pip).

Thanks you all for the issue forwarding, python client fix, specification update!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants