From 0c76b191433b9b5a3be344f204b0eb7cd2ea50c4 Mon Sep 17 00:00:00 2001 From: Ariel Mashraki <7413593+a8m@users.noreply.github.com> Date: Tue, 12 May 2020 12:29:00 +0300 Subject: [PATCH] doc: update docs regarding entc template formats (#489) --- doc/md/code-gen.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/doc/md/code-gen.md b/doc/md/code-gen.md index 3b9f8201c..4ea106f02 100755 --- a/doc/md/code-gen.md +++ b/doc/md/code-gen.md @@ -104,7 +104,12 @@ Flags: `entc` accepts external Go templates to execute. If the template name is already defined by `entc`, it will override the existing one. Otherwise, it will write the execution output to -a file with the same name as the template. +a file with the same name as the template. The flag format supports `file`, `dir` and `glob` +as follows: + +```console +entc generate --template --template glob="path/to/*.tmpl" ./ent/schema +``` Example of a custom template provides a `Node` API for GraphQL - [Github](https://github.com/facebookincubator/ent/blob/master/entc/integration/template/ent/template/node.tmpl).