Skip to content

Commit

Permalink
add legal command for printing notices
Browse files Browse the repository at this point in the history
  • Loading branch information
rmg committed Oct 19, 2015
1 parent 1170fff commit 48fc697
Show file tree
Hide file tree
Showing 2 changed files with 79 additions and 0 deletions.
78 changes: 78 additions & 0 deletions commands/legal.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
// Copyright 2015 Datajin Technologies, Inc. All rights reserved.

package commands

import "github.com/codegangsta/cli"

// This software is provided "AS IS" but the service it connects to has its own
// terms and polcies.
const notices = `
Use of the mktmpio service is subject to the the following:
* mktmpio Privacy Policy
https://mktmp.io/privacy-policy
* mktmpio Terms of Service
https://mktmp.io/terms-of-service
`

// The dependencies list below is manually populated using the output from:
// go list -f {{.Deps}} ./...
const thirdparty = `
This binary includes 3rd party software:
* github.com/codegangsta/cli
MIT license
Copyright (C) 2013 Jeremy Saenz
* github.com/mitchellh/go-homedir
MIT license
Copyright (c) 2013 Mitchell Hashimoto
* github.com/mktmpio/go-mktmpio
Artistic-2.0 license
Copyright (c) 2015 Datajin Technologies, Inc.
* golang.org/x/crypto/ssh/terminal
golang.org/x/net/websocket
BSD-2 license
Copyright (c) 2009 The Go Authors. All rights reserved.
* gopkg.in/yaml.v2
LGPL3 license
Copyright (c) 2011-2014 - Canonical Inc.
`

// This software is provided "AS IS"
const warranties = `
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
`

// Contact info
const contact = `
For more information contact Datajin Technologies, Inc.:
w: https://mktmp.io
e: [email protected]
`

// Definition for the 'mktmpio config' command
var LegalCommand = cli.Command{
Name: "legal",
Usage: "display licensing, copyright, and warranty notices",
Action: licenseAction,
}

func licenseAction(c *cli.Context) {
c.App.Writer.Write([]byte("\nNOTICES:\n" + notices))
c.App.Writer.Write([]byte("\nWARRANTIES:\n" + warranties))
c.App.Writer.Write([]byte("\n3RD PARTY SOFTWARE:\n" + thirdparty))
c.App.Writer.Write([]byte("\nCONTACT:\n" + contact))
}
1 change: 1 addition & 0 deletions mktmpio.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ func mktmpioApp() *cli.App {
Writer: os.Stdout,
Commands: []cli.Command{
commands.ShellCommand,
commands.LegalCommand,
},
Flags: []cli.Flag{
cli.StringFlag{
Expand Down

0 comments on commit 48fc697

Please sign in to comment.