1
0
Fork 0
mirror of https://github.com/tldr-pages/tldr.git synced 2025-07-25 11:15:24 +02:00

style-guide: add Range syntax (#9646)

* style-guide: standardize range syntax

* Simplify syntax for arbitraty integer placeholders

* Describe syntax for arbitraty floats
This commit is contained in:
Emily Grace Seville 2023-01-03 13:44:04 +10:00 committed by GitHub
parent 1b05651161
commit 2190f4031f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -109,6 +109,17 @@ Example:
- Use GNU-style **long options** (like `--help` rather than `-h`) when they are cross-platform compatible (intended to work the same across multiple platforms).
- In other cases use short options (like `-h`).
## Range syntax
All borders of integer and float ranges are included. If you wanna exclude
one border then use incremented or decremented values to do it:
`{{1..5}}` == `[1-6)`.
- Use `{{from..to}}` syntax for closed ranges.
- Use `{{-infinity..to}}` or `{{from..infinity}}` syntax for integer partially closed ranges.
- Use `{{integer}}` syntax for values where any integer is valid.
- Use `{{float}}` syntax for values where any float is valid.
## Placeholder syntax
User-provided values should use the `{{placeholder}}` syntax