From 00703e2a0c8ca10b92daf7790b7e87b3c99ca6e6 Mon Sep 17 00:00:00 2001 From: Managor <42655600+Managor@users.noreply.github.com> Date: Tue, 25 Mar 2025 00:26:09 +0200 Subject: [PATCH] style-guide: further clarify option grouping and move keypress order instructions (#16016) Update style-guide.md --- contributing-guides/style-guide.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/contributing-guides/style-guide.md b/contributing-guides/style-guide.md index 5c874b49d2..c8ee45fed4 100644 --- a/contributing-guides/style-guide.md +++ b/contributing-guides/style-guide.md @@ -426,7 +426,8 @@ For example, `[d]ownload` in English may be translated into `[d]escargar` in Spa - For user-friendliness, prefer **GNU-style long options** (like `--help` rather than `-h`). Make sure that the options are cross-platform compatible (intended to work the same across multiple platforms) for pages in the `common` directory. - If a command only supports short options or the short option greatly differs from the long option, attempt to document what the letter is short for with a [mnemonic](#short-option-mnemonics). - For letting the client decide whether to show long or short options in commands, use an option placeholder i.e. `{{[-o|--output]}}`. -- Prefer grouping options together when the program supports it (i.e. `{{[-it|--interactive --tty]}}` instead of `{{[-i|--interactive]}} {{[-t|--tty]}}`). +- Prefer grouping flag options together when the program supports it (i.e. `{{[-it|--interactive --tty]}}` instead of `{{[-i|--interactive]}} {{[-t|--tty]}}`). +- Prefer not grouping options that take in arguments (i.e. `{{[-it|--interactive --tty]}} {{[-w|--workdir]}} {{path/to/directory}}` instead of `{{[-itw|--interactive --tty --workdir]}} {{path/to/directory}}`) - Prefer using a space instead of the equals sign (`=`) to separate options from their arguments (i.e. use `--opt arg` instead of `--opt=arg`), unless the program does not support it. - Likewise prefer separating shortform options from their arguments with a space (i.e. use `-o arg` instead of `-oarg`), unless the program does not support it. @@ -491,10 +492,10 @@ To mark keypresses for TUI or GUI programs, use angle brackets `<` and `>`. - Single character example: ``. - Special keys are to be written with [`PascalCase`](https://www.theserverside.com/definition/Pascal-case): ``, ``, ``, ``, ``, `` instead of marking it with shift. Otherwise always mark characters in lowercase. - Mark simultaneous keypresses inside the same angle brackets separated by a single space: ``, ``, ``, ``. +- When writing simultaneous keypresses, keep the following order: `` -> `` / `` -> `` -> `` -> `` -> everything else. - Consecutive keypresses need to be contained in their own angle brackets with no space in between: ``, ``, `<~><.>`, ``. - Keys that are typed into a prompt do not need to be marked as keypresses: `<:>help`. Note that the context switching keypress is marked in angle brackets despite printing on the prompt.