@@ -7,17 +7,15 @@ author: Eric Vidal <eric@obarun.org>
# 66-env
Lists or replaces an environment variable of a service depending on the options passed.
Handles an environment file and variable of a service depending on the options passed.
## Interface
```
66-env [ -h ] [ -z ] [ -v verbosity ] [ -t tree ] [ -d dir ] [ -L ] [ -e ] [ -r key=value ] service
66-env [ -h ] [ -z ] [ -v verbosity ] [ -t tree ] [ -c version ] [ -s version ] [ -V|L ] [ -r key=value ] [ -i src,dst ] [ -e ] service
```
- This program opens and reads the configuration file of *service* found by default at `%%service_admconf%%`
- It displays the contents of the file or replaces a `key=value` pair if instructed to do so with the **‑r** option.
- This program allows to handle the configuration file of *service* found by default at `%%service_admconf%%/<service>`. Depending of the options passed, you can displays the contents of the file, see the current version used, edits the configuration file and so on.
## Exit codes
...
...
@@ -39,14 +37,24 @@ Lists or replaces an environment variable of a service depending on the options
-**-t** : handles the *selection* of the given *tree*. This option is mandatory except if a tree was marked as 'current'—see [66-tree](66-tree.html).
-**-d***dir* : use *dir* as configuration file directory instead of the default one.
-**-c***version* : makes *version* as the current one to use by default. If the service is already running, you need to restart the *service* to apply the change by the command e.g. `66-start -r <service>`.
-**-L**: list defined environment variables for service.
-**-s***version* : specifies the version to handles with the options **-V**, **-L**, **-r** and **-e** instead of using the current one.
-**-e** : edit the configuration file with `EDITOR` set in your system environment. This is the default option if **-L** or **-r** was not passed.
-**-V** : lists available versioned configuration directories of the *service*. The term `current` is used to specific the current version in use as follow:
````
0.2.0
0.1.4 current
````
-**-r***key=value* : override an existing `key=value` pair with the given one. The `key=value` needs to be single quoted in case of multiple arguments.
-**-L** : lists defined environment variables for the *service*. It do the same for all files found at the configuration directory.
-**-i***src,dst* : imports configuration file from *src* version to *dst* version. The *src* version and *dst* version need to be separated by a comma without space before and after it. It **do not import** the configuration written by the `66-enable` process but only deal with extra configuration files written by the sysadmin.
-**-e** : edit the configuration file with `EDITOR` set in your system environment. This is the default option if neither option is passed. If you use this option with a `sudo` command, you need to specify the `-E` option at sudo call—see [examples](66-env.html#Usage examples).
## Usage examples
```
...
...
@@ -55,6 +63,14 @@ Lists or replaces an environment variable of a service depending on the options