You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This script helps you use `scw` command-line easily by generating a bash completion everytime you hit the `tab` key.
4
+
5
+
## How it works
6
+
7
+
- Simply copy the script named `scw.bash` to `/etc/bash_completion.d` it will be sourced everytime you login or you simulate a login.
8
+
- You can also put it in your `HOMEDIR` and source it with your login shell option by adding the following line in your `~/.bash_profile`:
9
+
```
10
+
source ~/.scw.bash
11
+
```
12
+
13
+
## Tuning variables
14
+
15
+
For more flexibility the behaviour of the completion if controlled by the following vars:
16
+
17
+
-**GET_SCW_SRVS**: it could be an env variable in your shell set by the command `export GET_SCW_SRVS="yes"`. If this option is enabled the completion will call Scaleway API to fetch for your managed servers and displays them. It default to "no" because fetching servers names takes around 1s which is quite long for command-line completion.
18
+
-**GET_SCW_IMGS**: it could be an env variable in your shell set by the command `export GET_SCW_IMGS="yes"`. If this option is enabled the completion will call Scaleway API to fetch for the available images and displays them. It default to "no" because fetching images takes around 1s which is quite long for command-line completion.
19
+
-**nospace**: this is a built-in shell completion option when set to `-o nospace` allows you to remove the space add to word when the completion happens.
20
+
21
+
## TODO
22
+
23
+
- Tune every function completion for more parsing options by tracking all the sub-options and handle them.
0 commit comments