tldr-pages / tldr

📚 Collaborative cheatsheets for console commands
https://tldr.sh
Other
51.57k stars 4.24k forks source link

decision/docs: keep or change the approach for #8786 and #7596 and document this #12316

Open vitorhcl opened 9 months ago

vitorhcl commented 9 months ago

We decided on #7596 the following approach:

The adopted solution is to align page names to Debian's binary names, due to the fact that Debian is the most popular base distro. Then,

if the binary is shipped under an alias on another non-Debian-based distro:

We add the following line before More information::

> On <insert distro>, this program is installed as `<insert alias>`.

if the name is taken by another program on another non-Debian-based distro (i.e. needs disambiguation):

We add the following line before More information::

> On <insert distro>, the binary name `<insert name>` is taken by another program. See `tldr <insert Debian name for that program>`.

Consider the command lid from the id-utils package, and lid from the libuser package.

The solution here is to document id-utils's lid under lid.md, and document libuser's lid under libuser-lid.md. This is in alignment with Debian's naming.

Then, we added a disambiguation note to lid.md pointing to libuser-lid.md. Conversely, we added an alias note to libuser-lid.md pointing to lid.md.

Note that this solution ONLY covers the very specific case of "commands that have conflicting names across various linux distros", NOT the more general case of "commands have conflicting names". That should probably be discussed and decided on a case-by-case basis.

If this explanation is incorrect, I hereby give permission for maintainers to edit this comment to keep the history of this issue tidy, so long as you leave a changelog behind.

We can take a similar approach for binary conflicts within the same distro.

However, @EmilyGraceSeville7cf suggested consecutive dashes for distinguishing commands, which I think is a good approach because we already use a single dash for subcommands. What do you think?

Also, we need to properly document this on CONTRIBUTING.md.

cyqsimon commented 1 week ago

However, @EmilyGraceSeville7cf suggested consecutive dashes for distinguishing commands, which I think is a good approach because we already use a single dash for subcommands. What do you think?

So to clarify, what's being suggested here is to use <PACKAGE_NAME>-- as a prefix in case of conflicts correct? The implications here being that the TLDR filename would be a unique identifier of one specific binary of one specific package, and no longer align with the install name chosen by any particular distro.

To be honest, despite the fact that it was largely me who proposed the solution in #7596, I actually prefer this one. In one of the prior comments, you can see that it's the same spirit as what's proposed here.

Because the entire notion of "the more popular distro" is unstable at best and entirely subjective at worst. On the first point, Debian is very popular today sure (largely due to Ubuntu), but as is the case with anything that's subject to change; and on the second, Debian may be more popular in the desktop space but many enterprise/HPC environments are almost entirely Fedora and RHEL.