mirror of
https://github.com/Belphemur/CBZOptimizer.git
synced 2025-10-14 04:28:51 +02:00
feat: add version command
This commit is contained in:
21
cmd/version_command.go
Normal file
21
cmd/version_command.go
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
package cmd
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/belphemur/CBZOptimizer/meta"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
command := &cobra.Command{
|
||||||
|
Use: "version",
|
||||||
|
Short: "Print the version of the application",
|
||||||
|
Long: "Print the version of the application",
|
||||||
|
Run: VersionCommand,
|
||||||
|
}
|
||||||
|
AddCommand(command)
|
||||||
|
}
|
||||||
|
|
||||||
|
func VersionCommand(_ *cobra.Command, _ []string) {
|
||||||
|
fmt.Printf("CBZOptimizer %s [%s] built [%s]\n", meta.Version, meta.Commit, meta.Date)
|
||||||
|
}
|
5
meta/version.go
Normal file
5
meta/version.go
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
package meta
|
||||||
|
|
||||||
|
var Version = "v0.0.0"
|
||||||
|
var Commit = ""
|
||||||
|
var Date = ""
|
Reference in New Issue
Block a user