style-guide.md: write rules for short/long options (#9527)

* Write rules for short/long options

* Apply suggestions from code review

* Update contributing-guides/style-guide.md

* Remove note about `common/`

* Reword note about GNU style options
This commit is contained in:
Emily Grace Seville
2022-12-08 16:27:26 +10:00
committed by GitHub
parent 44fc59e816
commit 92623218aa

View File

@@ -104,6 +104,11 @@ Example:
``` ```
- Pre-translated alias page templates can be found [here](https://github.com/tldr-pages/tldr/blob/main/contributing-guides/translation-templates/alias-pages.md). - Pre-translated alias page templates can be found [here](https://github.com/tldr-pages/tldr/blob/main/contributing-guides/translation-templates/alias-pages.md).
## Option syntax
- Use GNU-style **long options** (like `--help` rather than `-h`) when they are cross-platform compatible (available on multiple platforms where a command is intended to work among `android`, `linux`, `osx`, `sunos`, `windows`).
- In other cases use short options (like `-h`).
## Token syntax ## Token syntax
User-provided values should use the `{{token}}` syntax User-provided values should use the `{{token}}` syntax