2024-12-29 16:46:19 +01:00
|
|
|
package cmd
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
2025-01-01 20:52:09 +01:00
|
|
|
"strings"
|
2024-12-29 16:46:19 +01:00
|
|
|
|
2025-01-01 20:52:09 +01:00
|
|
|
t "go.wzykubek.xyz/licensmith/internal/template"
|
2024-12-29 16:46:19 +01:00
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func init() {
|
2025-01-01 20:52:09 +01:00
|
|
|
rootCmd.AddCommand(listCmd)
|
2024-12-29 16:46:19 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
var listCmd = &cobra.Command{
|
|
|
|
Use: "list",
|
|
|
|
Short: "List available licenses",
|
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
2025-01-01 20:52:09 +01:00
|
|
|
templates := t.List()
|
|
|
|
fmt.Println(strings.Join(templates, ", "))
|
2024-12-29 16:46:19 +01:00
|
|
|
},
|
|
|
|
}
|