tldr-pages/tldr-c-client

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

Dentrax opened this issue · 4 comments

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)

Footnotes

  1. https://github.com/tldr-pages/tldr/issues/7376

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.

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

@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:

fprintf(stdout, "Local data is older than two weeks, use --update to update it.\n\n");

and the function is called here:

tldr-c-client/src/tldr.c

Lines 116 to 118 in af7501f

if (!update_flag) {
check_localdate();
}

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?

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