Skip to content
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

Detect new platforms automatically #403

Open
niklasmohrin opened this issue Jan 9, 2025 · 0 comments
Open

Detect new platforms automatically #403

niklasmohrin opened this issue Jan 9, 2025 · 0 comments
Labels
discussion The details of this issue have not been figured out yet. spec This issue involves the tldr client specification.

Comments

@niklasmohrin
Copy link
Collaborator

Version 2.1 of the client specification suggests to "detect new platforms added to the relevant pages directory automatically".

I am not sure how I feel about this suggestion. The specification does not give a clear indication what platforms exist and how to detect this existence. The set of platforms was always given implicitly by the pages that existed, and new platforms were seemingly added conservatively (#354). However, there is also the special case of the "macos" platform which should alias to "osx".

If we were to move to discover the set of platforms from the directory, we would change our enum PlatformType to be a struct PlatformType(String) or similar. Since we would still want to display some possible values for --platform in tldr --help, we would either have to choose some platforms to display, or discover the platforms every time we run tldr --help. The latter approach is very complicated though, because we need to parse command line parameters and compute the effective configuration before we know where to look for pages in the first place.

Overall, I am not sold on this feature for now and am unlikely to accept PRs before we clear things up. Discussion welcome :)

CC @dbrgn @kbdharun

@niklasmohrin niklasmohrin added discussion The details of this issue have not been figured out yet. spec This issue involves the tldr client specification. labels Jan 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion The details of this issue have not been figured out yet. spec This issue involves the tldr client specification.
Development

No branches or pull requests

1 participant