diff options
| author | Shulhan <ms@kilabit.info> | 2023-11-17 01:29:56 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2023-11-17 01:39:38 +0700 |
| commit | 68cbc52f2195063a0b4c9ce8c6c4cf030182c53a (patch) | |
| tree | 1021d585b9d2b868522451b5e49d98181a311ab3 /testdata/env_set_test.data | |
| parent | 1946b89dba839e337853480e7a8e0a1e95c195ab (diff) | |
| download | awwan-68cbc52f2195063a0b4c9ce8c6c4cf030182c53a.tar.xz | |
all: implement command to set environment value with "env-set"
The env-set command set the value of environment file. Syntax,
<file> <key> <value>
The "file" argument define path to environment file.
The "key" argument define the key to be set using "section:sub:name"
format.
The "value" argument define the value key.
For example, to set the value for "name" under section "host" to
"myhost" in file "awwan.env" run
$ awwan env-set awwan.env host::name myhost
To set the value for key "pass" under section "user" subsection "database"
to value "s3cret" in file "awwan.env" run
$ awwan env-set awwan.env user:database:pass s3cret
Diffstat (limited to 'testdata/env_set_test.data')
| -rw-r--r-- | testdata/env_set_test.data | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/testdata/env_set_test.data b/testdata/env_set_test.data new file mode 100644 index 0000000..861a817 --- /dev/null +++ b/testdata/env_set_test.data @@ -0,0 +1,26 @@ +Test input and output for EnvSet. + +<<< withEmptyFile:error +EnvSet: empty file argument + +<<< withEmptyKey:error +EnvSet: empty key + +<<< withEmptyValue:error +EnvSet: empty value + +<<< withMissingSection:error +EnvSet: missing section in key + +<<< withMissingName:error +EnvSet: missing name in key + +<<< withFileNotExist +[host] +name = awwan + + +<<< withOverwriteValue +[host] +name = overwrite + |
