Separate multiple --extra variables with , instead of ;

pull/6/head^2
Mickaël Menu 3 years ago
parent 4bf660f934
commit 7dc3120d3a
No known key found for this signature in database
GPG Key ID: 53D73664CD359895

@ -8,3 +8,8 @@ All notable changes to this project will be documented in this file.
* Support for tags.
* Many tag flavors are supported: `#hashtags`, `:colon:separated:tags:` and even Bear's [`#multi-word tags#`](https://blog.bear.app/2017/11/bear-tips-how-to-create-multi-word-tags/). If you prefer to use a YAML frontmatter, list your tags with the keys `tags` or `keywords`.
### Changed
* Multiple `--extra` variables are now separated by `,` instead of `;`.

@ -16,7 +16,7 @@ type New struct {
Title string `short:t placeholder:TITLE help:"Title of the new note."`
Group string `short:g placeholder:NAME help:"Name of the config group this note belongs to. Takes precedence over the config of the directory."`
Extra map[string]string ` help:"Extra variables passed to the templates."`
Extra map[string]string ` help:"Extra variables passed to the templates." mapsep:","`
Template string `type:path placeholder:PATH help:"Custom template used to render the note."`
PrintPath bool `short:p help:"Print the path of the created note instead of editing it."`
}

@ -20,11 +20,11 @@ visibility = "private" # overrides
## Dynamic extra variables
Maybe more useful, you can provide additional extra variables dynamically to `zk new` from the command-line with `--extra`. Multiple variables must be separated by a semicolon `;`, in which case quoting the argument is required.
Maybe more useful, you can provide additional extra variables dynamically to `zk new` from the command-line with `--extra`. Multiple variables can be separated by a comma `,`.
```sh
$ zk new --extra author=Thomas
$ zk new --extra "show-header=1;author=Thomas"
$ zk new --extra show-header=1,author=Thomas
```
## Using extra variables in templates

Loading…
Cancel
Save