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

CLIENT-SPECIFICATION: add longform/shortform specifications #15253

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Managor
Copy link
Collaborator

@Managor Managor commented Dec 20, 2024

See these for more information:
#13556
tldr-pages/tldr-python-client#259

  • The page(s) are in the correct platform directories: common, linux, osx, windows, sunos, android, etc.
  • The page(s) have at most 8 examples.
  • The page description(s) have links to documentation or a homepage.
  • The page(s) follow the content guidelines.
  • The page(s) follow the style guide.
  • The PR title conforms to the recommended templates.
  • Version of the command being documented (if known):

@github-actions github-actions bot added the documentation Issues/PRs modifying the documentation. label Dec 20, 2024
@Managor Managor marked this pull request as draft December 20, 2024 03:27
@Managor
Copy link
Collaborator Author

Managor commented Dec 20, 2024

For now, I'm looking for feedback before opening for review.

@kbdharun kbdharun self-assigned this Dec 20, 2024
Copy link
Member

@sebastiaanspeck sebastiaanspeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Copy link
Member

@acuteenvy acuteenvy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The current syntax (i.e. {{-s|--long}}) doesn't work for programs that don't follow this convention for options (e.g. nuclei - example short|long option placeholder: {{-l|-list}}, and now there's no way for a client to distinguish this from an ordinary choice placeholder). If we standardize this, it's going to be hard to change it to support different option conventions in the future, hence I'd like to propose an alternative syntax.

#5092 was a proposal to use {[ ... ]} for option selection. That is not backwards compatible, because it uses a single curly brace, which makes it not a placeholder by the current specification.
What if we combine the two (i.e. use {{[-s|--long]}})? Current clients will display [-s|--long] with placeholder styling, which still looks like a choice, and on top of that a short option doesn't need to start with a single hyphen, and a long option doesn't need to start with two hyphens. As long as the square brackets are included, an option can be whatever we want it to be, allowing even for subcommand short forms (e.g. cargo {{[b|build]}}).

What do you think about this?

@Managor
Copy link
Collaborator Author

Managor commented Dec 30, 2024

After mulling it over, I've come to accept the idea. There needs to be flexibility to add arbitrary shortform/longform arguments.

Do you think it would be good to make the expected default behavior to only show the longform options. It would remove clutter for new users. I don't think having -s|--longform plastered everywhere is very newbie friendly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Issues/PRs modifying the documentation.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants