-
Notifications
You must be signed in to change notification settings - Fork 142
Description
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 :)