replace ${...}
expressions in text
USAGE:
kay [OPTIONS]
FLAGS:
-h, --help Prints help information
-V, --version Prints version information
OPTIONS:
-i, --input-file <input-file>
-o, --output-file <output-file>
-v, --vars-file <vars-file>
--vars-format <vars-format>
- if
--input-file
/-i
is omited, input will be expected fromstdin
- if
--output-file
/-o
is omited, output will go tostdout
- if
--vars-file
is omited, input may only use environment variables \${ ... }
will not be translated- format of
vars file
file is inferred from extension.yaml
/.yml
/.json
but can be specified by--vars-format yaml
or--vars-format json
- input must be utf8 (this might change, see TODO)
input.txt
hello ${var $.world}!
vars.json
:
{ "world": "jsonWORLD!" }
vars.yaml
:
world: yamlWORLD
$ kay -i input.txt --vars-file vars.json
hello jsonWORLD
$ kay -i input.txt --vars-file vars.yaml
hello yamlWORLD
$ echo 'happy ${env TEST_VAR}!' | TEST_VAR="birthday" kay
happy birthday!
- respect BOM
- make a proper expression parser
- support for piping expression results