Add titles command to show all IDs and titles

Signed-off-by: Oliver Davies <oliver@oliverdavies.uk>
This commit is contained in:
Oliver Davies 2025-09-23 23:56:47 +01:00
parent 12a0353a4c
commit 9019f4579d
10 changed files with 150 additions and 246 deletions

View file

@ -37,6 +37,8 @@ func Execute() {
}
func init() {
rootCmd.AddCommand(titlesCmd)
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.

26
cmd/titles.go Normal file
View file

@ -0,0 +1,26 @@
package cmd
import (
"github.com/spf13/cobra"
"code.oliverdavies.uk/opdavies/cmd-zet/internal/lib"
)
var titlesCmd = &cobra.Command{
Use: "titles",
Aliases: []string{"t"},
Short: "A brief description of your command",
Long: `A longer description that spans multiple lines and likely contains examples
and usage of using your command. For example:
Cobra is a CLI library for Go that empowers applications.
This application is a tool to generate the needed files
to quickly create a Cobra application.`,
Run: func(cmd *cobra.Command, args []string) {
zetDir := "/home/opdavies/Documents/zet"
zets := lib.GetAllZets(zetDir)
lib.ParseZetList(zets)
},
}