Add built-in licenses info to README

This commit is contained in:
Albert Nigmatzianov 2017-04-20 21:07:48 +02:00
parent c8a68b34cc
commit 663c207ad2
3 changed files with 7 additions and 4 deletions

View file

@ -23,7 +23,7 @@ Many of the most widely used Go projects are built using Cobra including:
[![Build Status](https://travis-ci.org/spf13/cobra.svg "Travis CI status")](https://travis-ci.org/spf13/cobra)
[![CircleCI status](https://circleci.com/gh/spf13/cobra.png?circle-token=:circle-token "CircleCI status")](https://circleci.com/gh/spf13/cobra)
[![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra)
[![GoDoc](https://godoc.org/github.com/spf13/cobra?status.svg)](https://godoc.org/github.com/spf13/cobra)
![cobra](https://cloud.githubusercontent.com/assets/173412/10911369/84832a8e-8212-11e5-9f82-cc96660a4794.gif)
@ -257,9 +257,12 @@ license:
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.
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
To manually implement cobra you need to create a bare main.go file and a RootCmd file.

View file

@ -18,7 +18,7 @@ package cmd
func initGpl2() {
Licenses["gpl2"] = License{
Name: "GNU General Public License 2.0",
PossibleMatches: []string{"gpl2", "gnu gpl2"},
PossibleMatches: []string{"gpl2", "gnu gpl2", "gplv2"},
Header: `{{ .copyright }}
{{ .appName }} is free software; you can redistribute it and/or

View file

@ -18,7 +18,7 @@ package cmd
func initGpl3() {
Licenses["gpl3"] = License{
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: `
This file is part of {{ .appName }}.