From 79cf550823b9b3c7470387f4ffad9ec4f6c1f949 Mon Sep 17 00:00:00 2001 From: Will Norris Date: Thu, 25 Aug 2022 16:39:14 -0700 Subject: [PATCH] cmd/tailscale: add licenses subcommand Signed-off-by: Will Norris --- cmd/tailscale/cli/cli.go | 1 + cmd/tailscale/cli/licenses.go | 29 +++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 cmd/tailscale/cli/licenses.go diff --git a/cmd/tailscale/cli/cli.go b/cmd/tailscale/cli/cli.go index 4a73c4ce6..00fc24296 100644 --- a/cmd/tailscale/cli/cli.go +++ b/cmd/tailscale/cli/cli.go @@ -170,6 +170,7 @@ change in the future. bugReportCmd, certCmd, netlockCmd, + licensesCmd, }, FlagSet: rootfs, Exec: func(context.Context, []string) error { return flag.ErrHelp }, diff --git a/cmd/tailscale/cli/licenses.go b/cmd/tailscale/cli/licenses.go new file mode 100644 index 000000000..2c746d2c0 --- /dev/null +++ b/cmd/tailscale/cli/licenses.go @@ -0,0 +1,29 @@ +// Copyright (c) 2022 Tailscale Inc & AUTHORS All rights reserved. +// Use of this source code is governed by a BSD-style +// license that can be found in the LICENSE file. + +package cli + +import ( + "context" + + "github.com/peterbourgon/ff/v3/ffcli" +) + +var licensesCmd = &ffcli.Command{ + Name: "licenses", + ShortUsage: "licenses", + ShortHelp: "Get open source license information", + LongHelp: "Get open source license information", + Exec: runLicenses, +} + +func runLicenses(ctx context.Context, args []string) error { + outln(` +Tailscale wouldn't be possible without the contributions of thousands of open +source developers. To see the open source packages included in Tailscale and +their respective license information, visit: + + https://tailscale.com/licenses/tailscale`) + return nil +}