diff --git a/cmd/obp/cmd/hugo.go b/cmd/obp/cmd/hugo.go index 53ea0b2..2197c26 100644 --- a/cmd/obp/cmd/hugo.go +++ b/cmd/obp/cmd/hugo.go @@ -9,35 +9,22 @@ import ( "github.com/spf13/cobra" ) -var ( - source, target string -) - -// rootCmd represents the base command when called without any subcommands var hugoCmd = &cobra.Command{ Use: "hugo", 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 { // here is where I validate arguments, open and parse config files, etc return nil }, + RunE: func(cmd *cobra.Command, args []string) error { + return nil + }, } 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) }