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.
32 lines
693 B
Go
32 lines
693 B
Go
/*
|
|
Copyright © 2023 NAME HERE <EMAIL ADDRESS>
|
|
*/
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
"code.ndumas.com/ndumas/obsidian-pipeline"
|
|
)
|
|
|
|
// rootCmd represents the base command when called without any subcommands
|
|
var versionCmd = &cobra.Command{
|
|
Use: "version",
|
|
Short: "prints obp version info",
|
|
Long: `displays git tag and sha
|
|
`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Printf("Version: %s Build: %s\n", obp.Version, obp.Build)
|
|
},
|
|
}
|
|
|
|
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")
|
|
rootCmd.AddCommand(versionCmd)
|
|
|
|
}
|