-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathlicenses.go
More file actions
40 lines (32 loc) · 844 Bytes
/
licenses.go
File metadata and controls
40 lines (32 loc) · 844 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
40
/*
Copyright © 2025 NAME HERE <EMAIL ADDRESS>
*/
package cmd
import (
_ "embed"
"log"
"github.com/codesphere-cloud/cs-go/pkg/tmpl"
"github.com/spf13/cobra"
)
type LicensesCmd struct {
cmd *cobra.Command
}
func (c *LicensesCmd) RunE(_ *cobra.Command, args []string) error {
log.Println("Codesphere CLI License:")
log.Println(tmpl.License())
log.Println("=================================")
log.Println("Codesphere CLI licenses included work:")
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 Codesphere CLI license and open source licenses of dependencies.`,
},
}
rootCmd.AddCommand(licenses.cmd)
licenses.cmd.RunE = licenses.RunE
}