-
Notifications
You must be signed in to change notification settings - Fork 128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow querying multiple platforms #300
Allow querying multiple platforms #300
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for contributing! I have some change requests below, the main one is passing platforms
to the methods that need it and not storing it in the Cache
. This also includes handling multiple platforms in these methods instead of running them multiple times. Reviews might take a while here as @dbrgn and I are both relatively busy; feel free to ping us again here if we haven't checked in in a while or if you feel like we forgot you
Thank you for the code review and suggestions! I agree about passing in 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good :)
Some of my previous comments are still open, in particular what should happen with --list
, and whether we want to guarantee that we respect the order the platforms were given in. For the latter, I think we can always prioritize platforms that came first (as we already do) - so we would just need a test that covers this. @dbrgn Do you have opinions on behavior and whether we want to try to incorporate this into the spec?
Thanks for the feedback! I have now implemented the suggestions you have made. With regards to what should happen with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks very good now! I have some final remarks, mostly about testing, below.
There is also one comment from before that I think hasn't been addressed yet. A check should be added to make sure that when running tldr --platform linux --platform windows xyz
, a page for linux should be preferred, even if xyz
exists for both platforms. I think it could be tested in test_multiple_platform_command_search
.
I thought about the behavior for --list
some more and I think the current version is probably what we want. I am fine with the current behavior and if we ever need to change it, well, we can still change it :^)
thank you for the continuous feedback and help with this. I have pushed the changes for the testing :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me! Thank you for your contribution and sorry for the long wait :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the long wait! Your PR looks good and will be included in the next release. Thanks!
Hi, some (very late, I know) follow-up questions @niklasmohrin @jj-style:
|
|
I did not check if or how other clients support multiple platforms, sorry. Happy to update the help text in another PR either way! |
Help text PR is here: #375 |
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [dbrgn/tealdeer](https://github.com/dbrgn/tealdeer) | minor | `v1.6.1` -> `v1.7.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>dbrgn/tealdeer (dbrgn/tealdeer)</summary> ### [`v1.7.0`](https://github.com/dbrgn/tealdeer/blob/HEAD/CHANGELOG.md#v170-v170-2024-10-02) [Compare Source](tealdeer-rs/tealdeer@v1.6.1...v1.7.0) It's been 24 months since the last release, time for tealdeer 1.7.0! Thanks to 16 individual contributors, a few nice changes and features are included in this release. One change is that you can **query multiple platforms at once**. For example: tldr --platform openbsd --platform linux df This will show the `df` page for OpenBSD (if available), followed by Linux (if available), with fallback to the current platform on which tealdeer runs. What's that `openbsd` thing up there? Yes, there's now **support for the BSD platforms `freebsd`, `netbsd` and `openbsd`**. And since we're already talking about platform support: Our **binary releases now include builds for ARM64 (aka `aarch64`) on macOS (Apple Silicon, M1/M2/M3) and Linux**. *(Keep in mind that binary releases are generated in CI and are unsigned. For a trusted build, please compile from source.)* There's also a breaking change for the folks using [custom pages and patches](https://tealdeer-rs.github.io/tealdeer/usage_custom_pages.html): These files now use a `.md` extension. Old files will continue to work, but will result a deprecation warning being printed when used. On a personal note, this will be the last release from me ([Danilo](https://github.com/dbrgn/)) as primary maintainer of tealdeer. For details, see [#​376](tealdeer-rs/tealdeer#376). Changes: - \[added] Allow querying multiple platforms (\[[#​300](tealdeer-rs/tealdeer#300)]) - \[added] Add BSD platform support (\[[#​354](tealdeer-rs/tealdeer#354)]) - \[added] Allow building with native-tls in addition to rustls (\[[#​303](tealdeer-rs/tealdeer#303)]) - \[changed] Change custom page files to use a `.md` file extension (\[[#​322](tealdeer-rs/tealdeer#322)]) - \[changed] Update to clap v4 for doing command line parsing (\[[#​298](tealdeer-rs/tealdeer#298)]) - \[changed] Performance optimization in LineIterator (\[[#​314](tealdeer-rs/tealdeer#314)]) - \[changed] Performance optimizations by tweaking Cargo flags (\[[#​355](tealdeer-rs/tealdeer#355)]) - \[changed] Include completions in published crate (\[[#​333](tealdeer-rs/tealdeer#333)]) - \[changed] Minimal supported Rust version is now 1.75 (\[[#​298](tealdeer-rs/tealdeer#298)]) - \[fixed] Fix bash/zsh/fish completions when cache is empty (\[[#​327](tealdeer-rs/tealdeer#327)], \[[#​331](tealdeer-rs/tealdeer#331)]) - \[docs] Publish docs only when tagging a release (\[[#​362](tealdeer-rs/tealdeer#362)]) - \[docs] List Scoop and Debian packages (\[[#​305](tealdeer-rs/tealdeer#305)], \[[#​315](tealdeer-rs/tealdeer#315)]) - \[docs] Add "Tips and Tricks" chapter to user manual (\[[#​342](tealdeer-rs/tealdeer#342)]) - \[docs] Various docs improvements (\[[#​293](tealdeer-rs/tealdeer#293)]) - \[chore] Improvements to CI workflows (\[[#​324](tealdeer-rs/tealdeer#324)]) - \[chore] Update Cargo.toml license field following SPDX 2.1 (\[[#​336](tealdeer-rs/tealdeer#336)]) - \[chore] Dependency updates Contributors to this version: - \[Adam Henley]\[[@​adamazing](https://github.com/adamazing)] - \[Andrea Frigido]\[[@​frisoft](https://github.com/frisoft)] - \[Blair Noctis]\[[@​nc7s](https://github.com/nc7s)] - \[Danilo Bargen]\[[@​dbrgn](https://github.com/dbrgn)] - \[Felix Yan]\[[@​felixonmars](https://github.com/felixonmars)] - \[Iliia Maleki]\[[@​iliya-malecki](https://github.com/iliya-malecki)] - \[JJ Style]\[[@​jj-style](https://github.com/jj-style)] - \[K.B.Dharun Krishna]\[[@​kbdharun](https://github.com/kbdharun)] - \[Linus Walker]\[[@​Walker-00](https://github.com/Walker-00)] - \[Mohit Raj]\[[@​agrmohit](https://github.com/agrmohit)] - \[Nicolai Fröhlich]\[[@​nifr](https://github.com/nifr)] - \[Niklas Mohrin]\[[@​niklasmohrin](https://github.com/niklasmohrin)] - \[[@​qknogxxb](https://github.com/qknogxxb)]\[[@​qknogxxb](https://github.com/qknogxxb)] - \[[@​tveness](https://github.com/tveness)]\[[@​tveness](https://github.com/tveness)] - \[Y.D.X.]\[[@​YDX-2147483647](https://github.com/YDX-2147483647)] - \[Zacchary Dempsey-Plante]\[[@​zedseven](https://github.com/zedseven)] Thanks! </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
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.