drafting more lipgloss stuff

main
Nick Dumas 2 years ago
parent a0461d9e6b
commit 436c553894

@ -0,0 +1,43 @@
/*
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
*/
package cmd
import (
// "fmt"
"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`,
PreRunE: func(cmd *cobra.Command, args []string) error {
// here is where I validate arguments, open and parse config files, etc
return nil
},
}
func init() {
// 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)
}

@ -9,8 +9,7 @@ import (
"github.com/spf13/cobra"
"github.com/spf13/viper"
"code.ndumas.com/ndumas/obsidian-pipeline/gloss"
// "code.ndumas.com/ndumas/obsidian-pipeline/gloss"
)
var cfgFile string
@ -20,9 +19,10 @@ var rootCmd = &cobra.Command{
Use: "obp",
Short: "obp is a toolkit for managing your vault in headless contexts",
Long: `a suite of tools for managing your obsidian vault`,
// Uncomment the following line if your bare application
// has an action associated with it:
// Run: func(cmd *cobra.Command, args []string) { },
PreRunE: func(cmd *cobra.Command, args []string) error {
// here is where I validate arguments, open and parse config files, etc
return nil
},
}
// Execute adds all child commands to the root command and sets flags appropriately.
@ -47,8 +47,8 @@ func init() {
// 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.SetHelpFunc(gloss.CharmHelp)
// rootCmd.SetUsageFunc(gloss.CharmUsage)
}
// initConfig reads in config file and ENV variables if set.

Loading…
Cancel
Save