mirror of
https://github.com/openziti/zrok.git
synced 2025-01-24 23:09:32 +01:00
'version' command in zrok executable (#56)
This commit is contained in:
parent
204e59dad0
commit
33199b0e93
29
cmd/zrok/version.go
Normal file
29
cmd/zrok/version.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"github.com/openziti-test-kitchen/zrok/build"
|
||||||
|
"github.com/spf13/cobra"
|
||||||
|
)
|
||||||
|
|
||||||
|
func init() {
|
||||||
|
rootCmd.AddCommand(newVersionCommand().cmd)
|
||||||
|
}
|
||||||
|
|
||||||
|
type versionCommand struct {
|
||||||
|
cmd *cobra.Command
|
||||||
|
}
|
||||||
|
|
||||||
|
func newVersionCommand() *versionCommand {
|
||||||
|
cmd := &cobra.Command{
|
||||||
|
Use: "version",
|
||||||
|
Args: cobra.ExactArgs(0),
|
||||||
|
}
|
||||||
|
command := &versionCommand{cmd: cmd}
|
||||||
|
cmd.Run = command.run
|
||||||
|
return command
|
||||||
|
}
|
||||||
|
|
||||||
|
func (cmd *versionCommand) run(_ *cobra.Command, _ []string) {
|
||||||
|
fmt.Println(" _ \n _____ __ ___ | | __\n|_ / '__/ _ \\| |/ /\n / /| | | (_) | < \n/___|_| \\___/|_|\\_\\\n\n" + build.String() + "\n")
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user