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

Let's document: pacman #5256

Closed
7 tasks done
navarroaxel opened this issue Feb 8, 2021 · 11 comments
Closed
7 tasks done

Let's document: pacman #5256

navarroaxel opened this issue Feb 8, 2021 · 11 comments
Labels
decision A (possibly breaking) decision regarding tldr-pages content, structure, infrastructure, etc. new command Issues requesting creation of a new page or PRs adding a new page for a command. syntax Issues related to the content and markup of the pages.

Comments

@navarroaxel
Copy link
Collaborator

navarroaxel commented Feb 8, 2021

The pacman command is a Swiss army knife to manage packages in Arch Linux-based OS and we should extend the current pacman page in tldr creating specific pages for its subcommands.

The issue with pacman is that its subcommands are arguments in uppercase and the lowercased arguments are specific for that subcommand. If we review the pacman -Syu command to upgrade the system: -y/--refresh and -u/--sysupgrade are specific arguments for pacman -S or we can run the same command in its long form: pacman --sync --refresh --sysupgrade.

How should we name the page for -S/--sync argument? Maybe pacman-sync.md.

@navarroaxel navarroaxel added new command Issues requesting creation of a new page or PRs adding a new page for a command. decision A (possibly breaking) decision regarding tldr-pages content, structure, infrastructure, etc. help wanted You can help make tldr-pages better! labels Feb 8, 2021
@bl-ue
Copy link
Contributor

bl-ue commented Feb 8, 2021

How should we name the page for -S/--sync argument? Maybe pacman-sync.md.

I thought of somthing else, pacman--sync.md. It's slightly uglier, but it would clearly distinguish between pacman sync and pacman --sync.

But maybe that distinction is not necessary.

@bl-ue bl-ue added the syntax Issues related to the content and markup of the pages. label Feb 8, 2021
@nikisix
Copy link
Contributor

nikisix commented Feb 12, 2021

The git man documentation uses a single-dash separator between man <command>-<subcommand>.

Wouldn't the --sync flag be defined within the top-level pacman.md file?

I definitely understand pacman-sync.md being a thing.

@bl-ue
Copy link
Contributor

bl-ue commented Feb 12, 2021

@nikisix in an ordinary command, yes, but pacman doesn't have what are normally considered "subcommands"; instead -S/--sync is used just like a subcommand.

There are a lot of other options that are only available in the scope of the subcommand-like options (e.g. -T/--deptest, -D/--database, -F/--files), so there's not nearly enough space in pacman.md to document the useful capabilities of those "subcommands."

@sbrl
Copy link
Member

sbrl commented Feb 12, 2021

Since I assume that pacman has long-form options for each of the "subcommands", I think pacman-SUBCOMMAND_NAME is a good option. e.g. pacman --sync becomes pacman-sync for example.

A bit unusual yes, but pacman doesn't appear to follow norms established by other subcommand-based applications.

@bl-ue
Copy link
Contributor

bl-ue commented Feb 12, 2021

@sbrl did you see my pacman--sync.md idea?

@sbrl
Copy link
Member

sbrl commented Feb 12, 2021

I did, but I think keeping it similar to the existing subcommand system is perhaps better. But I do like the distinction you make there, I just think we should keep it simple.

@bl-ue
Copy link
Contributor

bl-ue commented Feb 21, 2021

Wow great job @navarroaxel—you actually got it all done and really quickly (less than a week!)

You get a 🥇 and ⭐✖️5️⃣   🌟✖️7️⃣!

@bl-ue
Copy link
Contributor

bl-ue commented Mar 8, 2021

Oops I forgot to close this 😄

@waldyrious
Copy link
Member

Just logging my opinion, after the fact, that I'd initially be inclined to agree with @bl-ue's suggestion to name the pages pacman--sync.md, etc.

At the moment we use hyphenated page names for three command formats:

  • Actual hyphenated commands, e.g. docker-compose.md --> $ docker-compose ...
  • Space-separated subcommands, e.g. git-commit.md --> $ git commit ...
  • flag-based subcommands, e.g. pacman-sync.md --> $ pacman --sync ...

Maybe we should consider a different convention to make things clearer? E.g.

  • docker-compose.md
  • git_status.md
  • pacman--sync.md

Of course, that may break down if additional patterns come up (who knows, there may be some obscure tool that uses an even weirder format). Anyway, I thought I'd throw the idea out there to hear your thoughts.

@bl-ue
Copy link
Contributor

bl-ue commented Mar 14, 2021

It's a good idea, because things can start becoming complex if you want to use the names in some way ( subcommand suggestion, etc.) and you have parent commands with dashes and subcommands, e.g. virt-admin server-update-tls (#5425) 😄

@sbrl
Copy link
Member

sbrl commented Mar 24, 2021

Hmm, interesting ideas here @bl-ue, @waldyrious!

It's an awkward one, because there's no set standard for how it's done. If we included any underscores, I'd suggest a client update because it's extra work to do shift + - as opposed to just hitting the space as we have currently.

Currently clients basically do echo "${page_name}" | tr ' ' '-', so perhaps pacman--sync would be the better solution to this issue here?

We could even do 3 dashes, because then you'd be able to do this:

tldr pacman --sync

....and it would be translated into this:

pacman---sync.md

Thinking about it some more here, I think I'd actually suggest that 3 dashes would be the most optimal solution because it wouldn't require a client update or require users to learn any new syntax.

@pixelcmtd pixelcmtd removed the help wanted You can help make tldr-pages better! label Oct 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
decision A (possibly breaking) decision regarding tldr-pages content, structure, infrastructure, etc. new command Issues requesting creation of a new page or PRs adding a new page for a command. syntax Issues related to the content and markup of the pages.
Projects
None yet
Development

No branches or pull requests

6 participants