Readme: update for loop syntax

This commit is contained in:
Akemi Izuko 2024-07-17 19:23:47 -06:00
parent 7293796883
commit 63ff7d5338
Signed by: akemi
GPG key ID: 8DE0764E1809E9FC

View file

@ -1,4 +1,4 @@
# SSH config+
# SSH Compose Pro
Streamline repetitive ssh config files with trait-style property inheritance!
@ -37,7 +37,7 @@ coronation:
Hostname: coronation.cs.ualberta.ca
```
## Quick Start
# Quick Start
```bash
mv ~/.ssh/config ~/.ssh/config_og
@ -59,7 +59,7 @@ python3 src/main.py <(python3 src/ssh_config_to_yaml.py ~/.ssh/config)
The `src/ssh_config_to_yaml.py` script will assist in quickly migrating your
existing config.
### SSH Properties
## SSH Properties
Standard SSH config properties go under the `ssh_props` heading for every host.
For example:
@ -89,7 +89,7 @@ github.com:
Note that yaml does not support duplicate keys, so keys can take a list of
properties instead to mimic repeated keys, as seen above.
### Templates
## Templates
Templates are "default" properties inherited from another host. Templates must
be declared above the host that uses it. You can make a template-only host by
@ -170,7 +170,7 @@ Host ohaton
LocalForward 9000 localhost:9000
```
### For loops
## For loops
For loops allow simple substitution of a single variable over a range or set of
values. Ranges must be numerical, but sets can be any arbitrary string. Multiple
@ -183,13 +183,11 @@ orca:
User: emiliko
for:
- variable: port
range:
from: 9026
to: 9042
range: [9026, 9042, 1]
property: LocalForward
template: ${port} localhost:${port}
- variable: env
range: ["FOO=bar", "BAR=foo"]
iter: ["FOO=bar", "BAR=foo"]
property: SendEnv
template: ${env}
```