mirror of
https://github.com/Luzifer/ots.git
synced 2025-08-02 03:06:12 -04:00
[#159] Add version-command for ots-cli
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
47a7a686ef
commit
f2a7af30b2
2 changed files with 21 additions and 0 deletions
19
cmd/ots-cli/cmd_version.go
Normal file
19
cmd/ots-cli/cmd_version.go
Normal file
|
@ -0,0 +1,19 @@
|
|||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var versionCmd = &cobra.Command{
|
||||
Use: "version",
|
||||
Short: "Displays the tool version",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Printf("ots-cli %s\n", version) //nolint:forbidigo
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
rootCmd.AddCommand(versionCmd)
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue