You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
956 B
Go
30 lines
956 B
Go
2 years ago
|
/*
|
||
|
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
|
||
|
*/
|
||
|
package cmd
|
||
|
|
||
|
import (
|
||
|
"github.com/spf13/cobra"
|
||
|
)
|
||
|
|
||
|
// rootCmd represents the base command when called without any subcommands
|
||
|
var validateCmd = &cobra.Command{
|
||
|
Use: "validate",
|
||
|
Short: "loads a note and ensures its frontmatter follows the provided protobuf schema",
|
||
|
Long: `parses frontmatter in a markdown note and attempts to write the struct out using the provided protobuf schema.
|
||
|
|
||
|
If the write succeeds, the data satisfies the schema.
|
||
|
`,
|
||
|
// Uncomment the following line if your bare application
|
||
|
// has an action associated with it:
|
||
|
// Run: func(cmd *cobra.Command, args []string) { },
|
||
|
}
|
||
|
|
||
|
func init() {
|
||
|
// 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")
|
||
|
validateCmd.Flags().StringP("schema", "s", "schema.proto", "path to protobuf file")
|
||
|
rootCmd.AddCommand(validateCmd)
|
||
|
}
|