tldr-pages / tldr-python-client

:snake: Python command-line client for tldr pages 📚
https://pypi.org/project/tldr/
MIT License
599 stars 95 forks source link

Make --update agree with the client specification #101

Closed zlatanvasovic closed 4 years ago

zlatanvasovic commented 4 years ago

Closes #40. Closes #84.

According to the client spec:

-u, --update | Conditional | Updates the offline cache of pages. MUST be implemented if cache is supported.

Caching If appropriate, it is RECOMMENDED that clients implement a cache of pages. If implemented, clients MUST download the archive either from http://tldr.sh/assets/tldr.zip or https://raw.githubusercontent.com/tldr-pages/tldr-pages.github.io/master/assets/tldr.zip (which is pointed by the first link).

Caching SHOULD be done according to the user's language configuration (if any), as to not waste unneeded space for unneeded languages. Additionally, clients MAY automatically update the cache on a regular basis.

-d option is confusing and not really necessary. Whole tldr's archive (with all the platforms and languages) is just 1.13 MB. It also has to be downloaded to update the cache anyway, so there's no point in nit-picking the pages.

This is also how node and C clients do it.

zlatanvasovic commented 4 years ago

@MasterOdin Since that's the case, we can also merge it right now and apply your suggestions here. They'd be resolved much easier.