tldr-pages / tldr-c-client

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

Should not error out "use --update to update it" if we pass `--update` flag #62

Closed Dentrax closed 2 years ago

Dentrax commented 2 years ago

Since we are passing the --update flag, I think throwing the following error might be unnecessary. We can write different logs here to improve the error message: ^1

$ tldr --update
Local data is older than two weeks, use --update to update it.
$ tldr --version
tldr v1.3.0 (v1.3.0)
marchersimon commented 2 years ago

Hey @Dentrax, this repository only contains the pages themselves, and don't have much to do with any clients. Which client do you use / where did you install it from? Looks like the Node.js client, but I'm not sure.

marchersimon commented 2 years ago

From looking at the source code, you seem to be using the C client.

marchersimon commented 2 years ago

@Dentrax this is really weird, because I don't have this issue. I don't even know how this issue can possibly arise, because this message get's printed here: https://github.com/tldr-pages/tldr-c-client/blob/af7501fd11a7045d0bf6282e8b333148347de482/src/local.c#L59

and the function is called here: https://github.com/tldr-pages/tldr-c-client/blob/af7501fd11a7045d0bf6282e8b333148347de482/src/tldr.c#L116-L118

So, when update_flag is true, the function can't get called. Where did you install the client and could you maybe recompile it yourself to see if the issue still exists?

MasterOdin commented 2 years ago

This was fixed in 1cf890db5fdd63e08dd364dd02e072c0639862d4 as part of the 1.4.0 release