Add version command

This commit is contained in:
Lea Anthony
2023-08-13 15:13:01 +10:00
parent ee29faecbf
commit c03c41cb21
3 changed files with 18 additions and 0 deletions
+2
View File
@@ -45,6 +45,8 @@ func main() {
plugin.NewSubCommandFunction("init", "Initialise a new plugin", commands.PluginInit)
//plugin.NewSubCommandFunction("add", "Add a plugin", commands.PluginAdd)
app.NewSubCommandFunction("version", "Print the version", commands.Version)
err := app.Run()
if err != nil {
pterm.Error.Println(err)
+15
View File
@@ -0,0 +1,15 @@
package commands
import (
_ "embed"
)
//go:embed version.txt
var VersionString string
type VersionOptions struct{}
func Version(_ *VersionOptions) error {
println(VersionString)
return nil
}
+1
View File
@@ -0,0 +1 @@
v3.0.0-alpha.0