diff options
| author | Dave Henderson <dhenderson@gmail.com> | 2023-04-04 08:42:23 -0400 |
|---|---|---|
| committer | Dave Henderson <dhenderson@gmail.com> | 2023-04-04 09:08:57 -0400 |
| commit | 72194feae77870190471d220898e2ccf1c7443a5 (patch) | |
| tree | cd386500fd5c08318e80fad78b87dbdc6126e04a /docs | |
| parent | cd3be0bb789acd4b48f6572cfd230e9100ac2d6c (diff) | |
New plugin args option
Signed-off-by: Dave Henderson <dhenderson@gmail.com>
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/content/config.md | 37 |
1 files changed, 34 insertions, 3 deletions
diff --git a/docs/content/config.md b/docs/content/config.md index 9e488e8a..dbdc5ce0 100644 --- a/docs/content/config.md +++ b/docs/content/config.md @@ -304,15 +304,19 @@ See [`--plugin`](../usage/#plugin). A map that configures custom functions for use in the templates. The key is the name of the function, and the value configures the plugin. The value is a map containing the command (`cmd`) and the options `pipe` (boolean) and `timeout` -(duration). +(duration). A list of optional arguments to always pass to the plugin can be set +with `args` (array of strings). -Alternatively, the value can be a string, which sets `cmd`. +Alternatively, the value can be a string, which sets only `cmd`. ```yaml -in: '{{ "hello world" | figlet | lolcat }}' +in: '{{ "world" | figlet | lolcat }}' plugins: figlet: cmd: /usr/local/bin/figlet + args: + - oh + - hello pipe: true timeout: 1s lolcat: /home/hairyhenderson/go/bin/lolcat @@ -322,6 +326,33 @@ plugins: The path to the plugin executable (or script) to run. +### `args` + +An array of optional arguments to always pass to the plugin. These arguments +will be passed _before_ any arguments provided in the template. + +For example: + +```yaml +plugins: + echo: + cmd: /bin/echo + args: + - foo + - bar +``` + +With this template: +``` +{{ echo "baz" }} +``` + +Will result the command being called like this: + +```console +$ /bin/echo foo bar baz +``` + ### `pipe` Whether to pipe the final argument of the template function to the plugin's |
