24 lines
461 B
Go
24 lines
461 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"strings"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"code.oliverdavies.uk/opdavies/cmd-zet/internal/lib"
|
|
)
|
|
|
|
var titlesCmd = &cobra.Command{
|
|
Use: "titles",
|
|
Aliases: []string{"t"},
|
|
Short: "Print IDs and titles of zettels",
|
|
Long: `Print the IDs and titles of all zettels.`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
zets := lib.GetAllZets()
|
|
|
|
result := lib.ParseZetList(zets)
|
|
|
|
fmt.Println(strings.Join(result, "\n"))
|
|
},
|
|
}
|