Closed jj-style closed 1 year ago
Thank you for the code review and suggestions! I agree about passing in platform
where it's needed and refactoring it out of the Cache
.
I'll have a crack at fixing these issues, I'm still somewhat new to rust but hopefully should be doable and will be a good learning experience!
p.s. thanks for the awesome project - it saves my bacon multiple times a day!
Feel free to ask about any problems you encounter, I will try to answer without unreasonable delays
Happy new year! Sorry it's taken me a while to respond to your feedback. I've given it an attempt to remove the platform
from the Cache
and pass in &[PlatformType]
on the methods that need it. It definitely feels better than looping the main program for each platform and creating multiple instances of the cache
Thanks for the feedback! I have now implemented the suggestions you have made.
With regards to what should happen with --list
when multiple platforms are provided - the current behaviour in cache.rs
with the pages.sort().dedup()
implies that the order the platforms are given is not important and the combined ordered set of pages should be listed.
I have added a test for this behaviour however, if we decide we want to list the pages grouped in order by the platforms supplied I can make this change
thank you for the continuous feedback and help with this. I have pushed the changes for the testing :)
Hi, some (very late, I know) follow-up questions @niklasmohrin @jj-style:
tldr --platform linux --platform windows
as opposed to something like tldr --platform linux,windows
? Or was that second alternative considered?I did not check if or how other clients support multiple platforms, sorry. I agree with @niklasmohrin about using the default clap behaviour but happy to see if there are other ways of doing it in clap that provide a more concise interface.
Happy to update the help text in another PR either way!
Help text PR is here: #375
Fix for an old issue #45 - to allow specifying multiple
platform
s on the cli. Behaviour is to try get the tldr page for each platform given - so if a page doesn't exist for one platform but does for another, you still get the page displayed.