starting on hugo command

main
Nick Dumas 2 years ago
parent f479ba4d4c
commit cff10a36ca

@ -9,35 +9,22 @@ import (
"github.com/spf13/cobra" "github.com/spf13/cobra"
) )
var (
source, target string
)
// rootCmd represents the base command when called without any subcommands
var hugoCmd = &cobra.Command{ var hugoCmd = &cobra.Command{
Use: "hugo", Use: "hugo",
Short: "convert a set of Obsidian notes into a Hugo compatible directory structure", Short: "convert a set of Obsidian notes into a Hugo compatible directory structure",
Long: `long description`, Long: `generate hugo content from your vault`,
PreRunE: func(cmd *cobra.Command, args []string) error { PreRunE: func(cmd *cobra.Command, args []string) error {
// here is where I validate arguments, open and parse config files, etc // here is where I validate arguments, open and parse config files, etc
return nil return nil
}, },
RunE: func(cmd *cobra.Command, args []string) error {
return nil
},
} }
func init() { func init() {
// hugoCmd.Flags().StringVar(&source, "source", "", "directory containing ready-to-publish posts")
// hugoCmd.Flags().StringVar(&target, "target", "", "target Hugo directory (typically content/posts)")
// Here you will define your flags and configuration settings.
// Cobra supports persistent flags, which, if defined here,
// will be global for your application.
hugoCmd.PersistentFlags().StringVar(&source, "source", "", "directory containing ready-to-publish posts")
hugoCmd.PersistentFlags().StringVar(&target, "target", "", "target Hugo directory (typically content/posts)")
// Cobra also supports local flags, which will only run
// when this action is called directly.
// rootCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
// rootCmd.SetHelpFunc(gloss.CharmHelp)
// rootCmd.SetUsageFunc(gloss.CharmUsage)
rootCmd.AddCommand(hugoCmd) rootCmd.AddCommand(hugoCmd)
} }

Loading…
Cancel
Save