mirror of
https://github.com/spf13/cobra
synced 2025-08-19 00:51:55 +00:00
Add built-in licenses info to README
This commit is contained in:
parent
c8a68b34cc
commit
663c207ad2
3 changed files with 7 additions and 4 deletions
|
@ -23,7 +23,7 @@ Many of the most widely used Go projects are built using Cobra including:
|
||||||
|
|
||||||
[](https://travis-ci.org/spf13/cobra)
|
[](https://travis-ci.org/spf13/cobra)
|
||||||
[](https://circleci.com/gh/spf13/cobra)
|
[](https://circleci.com/gh/spf13/cobra)
|
||||||
[](https://godoc.org/github.com/spf13/cobra)
|
[](https://godoc.org/github.com/spf13/cobra)
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
@ -257,9 +257,12 @@ license:
|
||||||
|
|
||||||
This is my license. There are many like it, but this one is mine.
|
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
|
My license is my best friend. It is my life. I must master it as I must
|
||||||
master my life.
|
master my life.
|
||||||
```
|
```
|
||||||
|
|
||||||
|
You can also use built-in licenses. For example, **GPLv2**, **GPLv3**, **LGPL**,
|
||||||
|
**AGPL**, **MIT**, **2-Clause BSD** or **3-Clause BSD**.
|
||||||
|
|
||||||
## Manually implementing Cobra
|
## Manually implementing Cobra
|
||||||
|
|
||||||
To manually implement cobra you need to create a bare main.go file and a RootCmd file.
|
To manually implement cobra you need to create a bare main.go file and a RootCmd file.
|
||||||
|
|
|
@ -18,7 +18,7 @@ package cmd
|
||||||
func initGpl2() {
|
func initGpl2() {
|
||||||
Licenses["gpl2"] = License{
|
Licenses["gpl2"] = License{
|
||||||
Name: "GNU General Public License 2.0",
|
Name: "GNU General Public License 2.0",
|
||||||
PossibleMatches: []string{"gpl2", "gnu gpl2"},
|
PossibleMatches: []string{"gpl2", "gnu gpl2", "gplv2"},
|
||||||
Header: `{{ .copyright }}
|
Header: `{{ .copyright }}
|
||||||
|
|
||||||
{{ .appName }} is free software; you can redistribute it and/or
|
{{ .appName }} is free software; you can redistribute it and/or
|
||||||
|
|
|
@ -18,7 +18,7 @@ package cmd
|
||||||
func initGpl3() {
|
func initGpl3() {
|
||||||
Licenses["gpl3"] = License{
|
Licenses["gpl3"] = License{
|
||||||
Name: "GNU General Public License 3.0",
|
Name: "GNU General Public License 3.0",
|
||||||
PossibleMatches: []string{"gpl3", "gpl", "gnu gpl3", "gnu gpl"},
|
PossibleMatches: []string{"gpl3", "gplv3", "gpl", "gnu gpl3", "gnu gpl"},
|
||||||
Header: `
|
Header: `
|
||||||
This file is part of {{ .appName }}.
|
This file is part of {{ .appName }}.
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue