-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlicenses.go
More file actions
39 lines (30 loc) · 831 Bytes
/
licenses.go
File metadata and controls
39 lines (30 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
// Copyright (c) Codesphere Inc.
// SPDX-License-Identifier: Apache-2.0
package cmd
import (
"log"
"github.com/codesphere-cloud/oms/internal/tmpl"
"github.com/spf13/cobra"
)
type LicensesCmd struct {
cmd *cobra.Command
}
func (c *LicensesCmd) RunE(_ *cobra.Command, args []string) error {
log.Println("OMS License:")
log.Println(tmpl.License())
log.Println("=================================")
log.Println("Open source components included:")
log.Println(tmpl.Notice())
return nil
}
func AddLicensesCmd(rootCmd *cobra.Command) {
licenses := LicensesCmd{
cmd: &cobra.Command{
Use: "licenses",
Short: "Print license information",
Long: `Print information about the OMS license and open source licenses of dependencies.`,
},
}
rootCmd.AddCommand(licenses.cmd)
licenses.cmd.RunE = licenses.RunE
}