From 4e48824fc05ac586622ef44e0354a740ed35d6f9 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Tue, 12 Sep 2023 21:25:29 +0200 Subject: [PATCH] docs: update README.md --- LICENSE | 19 +++++++++++++++++++ README.md | 50 ++++++++++++++++++-------------------------------- 2 files changed, 37 insertions(+), 32 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..bb67556 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright © 2023 Rob Watson. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the “Software”), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md index ec97808..f4141d7 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,22 @@ # envfilesubst -envfilesubst is a variation of gettext's envsubst, with a different modus -operandi. +envfilesubst is a variation of gettext's +[envsubst](https://www.gnu.org/software/gettext/manual/html_node/envsubst-Invocation.html), +with a different modus operandi. -Firstly, instead of reading the current environment, it instead parses a file -in "envfile" format. +Firstly, instead of reading the current environment it reads from file in +traditional "envfile" format. -Secondly, it will read from standard input and replace all variable references -that can be found in the envfile. If variables are not explicitly mentioned in -the envfile, the references will be left intact (instead of replacing them with -an empty string). +Secondly, it will read input from stdin replacing all variable references that +can be matched with the envfile. If variables are not explicitly mentioned in +the envfile, the references will be left untouched (instead of replacing them +with an empty string). + +## Git + +The main git repo is: https://git.netflux.io/rob/envfilesubst + +It is also mirrored on GitHub: https://github.com/rfwatson/envfilesubst ## Installation @@ -22,6 +29,7 @@ go install git.netflux.io/rob/envfilesubst@latest Given an envfile: ``` +# myenvfile FOO=bar X=1 ``` @@ -29,33 +37,11 @@ X=1 Then: ``` -echo "FOO is $FOO and X is ${X}. I don't know $BAR." | envfilesubst -f myenvfile +echo "FOO is $FOO and X is ${X}. I don't know $BAZ." | envfilesubst -f myenvfile ``` The output is: ``` -FOO is bar and X is 1. I don't know $BAR. +FOO is bar and X is 1. I don't know $BAZ. ``` - -## License - -Copyright © 2022 Rob Watson. - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the “Software”), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE.