cmd-zet/cmd/root.go

44 lines
1.1 KiB
Go
Raw Normal View History

2025-09-23 14:04:51 +01:00
package cmd
import (
"os"
"github.com/spf13/cobra"
)
var jsonOutput bool
2025-09-23 14:04:51 +01:00
// rootCmd represents the base command when called without any subcommands
var rootCmd = &cobra.Command{
Use: "zet",
Short: "Zettlekasten note manager",
Long: `Zettlekasten note manager`,
2025-09-23 14:04:51 +01:00
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
}
// Execute adds all child commands to the root command and sets flags appropriately.
// This is called by main.main(). It only needs to happen once to the rootCmd.
func Execute() {
err := rootCmd.Execute()
if err != nil {
os.Exit(1)
}
}
func init() {
rootCmd.AddCommand(createCmd)
rootCmd.AddCommand(editCmd)
rootCmd.AddCommand(findCmd)
2025-09-30 07:00:00 +01:00
rootCmd.AddCommand(linksCmd)
rootCmd.AddCommand(titlesCmd)
rootCmd.AddCommand(viewCmd)
2025-09-23 14:04:51 +01:00
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
// rootCmd.PersistentFlags().StringVar(&cfgFile, "config", "", "config file (default is $HOME/.zet.yaml)")
}