From 7dc3120d3ad72a9e9a7a5aafa6069b167263b811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mickae=CC=88l=20Menu?= Date: Sat, 6 Mar 2021 21:16:28 +0100 Subject: [PATCH] Separate multiple --extra variables with , instead of ; --- CHANGELOG.md | 5 +++++ cmd/new.go | 2 +- docs/config-extra.md | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe21a7f..6cc0ab0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 `;`. + diff --git a/cmd/new.go b/cmd/new.go index 6fef3ae..4167c37 100644 --- a/cmd/new.go +++ b/cmd/new.go @@ -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."` } diff --git a/docs/config-extra.md b/docs/config-extra.md index 6d91e7e..f5d15d7 100644 --- a/docs/config-extra.md +++ b/docs/config-extra.md @@ -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