From 44d55fb4d308b9ee64b7b189421730595300339a Mon Sep 17 00:00:00 2001 From: Warren Fernandes Date: Tue, 28 Apr 2020 11:49:46 -0600 Subject: [PATCH] Fix cobra command README (#1106) Describes the behavior of custom LICENSE generation using properties in ~/.cobra.yml --- cobra/README.md | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/cobra/README.md b/cobra/README.md index c360fdac..0f718c2b 100644 --- a/cobra/README.md +++ b/cobra/README.md @@ -88,12 +88,17 @@ author: Steve Francia license: MIT ``` +You can also use built-in licenses. For example, **GPLv2**, **GPLv3**, **LGPL**, +**AGPL**, **MIT**, **2-Clause BSD** or **3-Clause BSD**. + You can specify no license by setting `license` to `none` or you can specify a custom license: ```yaml +author: Steve Francia +year: 2020 license: - header: This file is part of {{ .appName }}. + header: This file is part of CLI application foo. text: | {{ .copyright }} @@ -102,5 +107,23 @@ license: master my life. ``` -You can also use built-in licenses. For example, **GPLv2**, **GPLv3**, **LGPL**, -**AGPL**, **MIT**, **2-Clause BSD** or **3-Clause BSD**. +In the above custom license configuration the `copyright` line in the License +text is generated from the `author` and `year` properties. The content of the +`LICENSE` file is + +``` +Copyright © 2020 Steve Francia + +This is my license. There are many like it, but this one is mine. +My license is my best friend. It is my life. I must master it as I must +master my life. +``` + +The `header` property is used as the license header files. No interpolation is +done. This is the example of the go file header. +``` +/* +Copyright © 2020 Steve Francia +This file is part of CLI application foo. +*/ +```