psibi / tldr-hs

Haskell tldr client
BSD 3-Clause "New" or "Revised" License
92 stars 14 forks source link

Client returns 0 for nonexistent commands #24

Closed samuel-w closed 4 years ago

samuel-w commented 4 years ago

Run the following:

tldr foo; echo $?

0 will be printed out, despite foo not having a tldr entry. Discovered by letompouce tldr-pages/tldr#4227

psibi commented 4 years ago

It seems the original issue seems to be using a different client based on the error message. The haskell one will fall back to the english locale if it doesn't find page based on the existing locale. Eg:

$ ~/g/tldr-hs (exit-code) $ tldr -L ja ss
ss
Utility to investigate sockets.

 - Show all TCP/UDP/RAW/UNIX sockets:

But again this client shows a wrong exit code if the page isn't found. I will fix it. Thanks for the report.

psibi commented 4 years ago

A new version v0.7.1 has been released which contains the fix.