Closed gutjuri closed 3 years ago
That was quick. Thanks! I'm liking this so far. I will review the MR once the CI passes.
I'm not seeing anywhere where the --update
workflow is handled ? Is that intended ?
What exactly are you referring to? Starting the programme with --update
invokes the code I have provided, if that's what you mean.
@gutjuri Ah, I see what you mean. Thanks! I tested your MR locally, and in it's initial use it outputs this:
$ tldr ls
No tldr entry for ls
Probably check whether the directory is initialized and if not try downloading and populating the cache ?
Also, there seems to be a speed difference of 3 second between the git version and the zip version of tldr --update
. But that seems fine, I guess. Not having dependency on git
is nice!
@gutjuri Ah, I see what you mean. Thanks! I tested your MR locally, and in it's initial use it outputs this:
$ tldr ls No tldr entry for ls
Probably check whether the directory is initialized and if not try downloading and populating the cache ?
Done. I also added an auto-update feature that updates the cache when it is older than 7 days.
Also, there seems to be a speed difference of 3 second between the git version and the zip version of
tldr --update
. But that seems fine, I guess. Not having dependency ongit
is nice!
Is the zip version the slower one? This isn't the case for me. I'm based in Europe, maybe tldr.sh is faster in Europe and github.com is faster in your region (if you're not based in Europe). Accessing both tldr.sh and github.com routes me to north american servers.
I also added an auto-update feature that updates the cache when it is older than 7 days.
Thanks, but I would prefer not have auto-update by default. I'm not opposed to introducing a configuration file where we can control this behavior.
Is the zip version the slower one?
Yeah. I guess it would also depend on other factors like which commit of git I'm in and so on.
I also added an auto-update feature that updates the cache when it is older than 7 days.
Thanks, but I would prefer not have auto-update by default. I'm not opposed to introducing a configuration file where we can control this behavior.
I see. I personally don't really like configuration files. I accommodated your wish by making the auto-update optional. Users now have to specify the command line option --auto-update-interval DAYS
if they wish to enable this functionality. For convenience I also added an explanation on how to set an alias in the command line configuration to have this feature without having to type out the option each time.
@gutjuri Should I go ahead and finish this MR ?
@gutjuri Should I go ahead and finish this MR ?
@gutjuri Thanks, I have released a new version with your changes.
closes #31
git
is no longer a dependency.Performance is not affected. The initialisation of the cache is much faster now. Even though updating the cache is no longer incremental, it is hardly slower.