Skip to content

Commit

Permalink
feat: version sub command
Browse files Browse the repository at this point in the history
  • Loading branch information
ega4432 committed May 29, 2022
1 parent c72765b commit a18dd58
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions cmd/version.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
package cmd

import (
"fmt"

"github.com/spf13/cobra"
)

// versionCmd represents the version command
var versionCmd = &cobra.Command{
Use: "version",
Short: "Print version",
Long: `Version prints the build information for rss-feed command executables.`,
Run: func(cmd *cobra.Command, args []string) {
fmt.Println("rss-feed version v0.1 -- HEAD")
},
}

func init() {
rootCmd.AddCommand(versionCmd)

// Here you will define your flags and configuration settings.

// Cobra supports Persistent Flags which will work for this command
// and all subcommands, e.g.:
// versionCmd.PersistentFlags().String("foo", "", "A help for foo")

// Cobra supports local flags which will only run when this command
// is called directly, e.g.:
// versionCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
}

0 comments on commit a18dd58

Please sign in to comment.