Skip to content

Commit

Permalink
Merge pull request #32 from fraunhoferfokus/development
Browse files Browse the repository at this point in the history
* add version cmd
  • Loading branch information
JGottschick authored Jun 3, 2024
2 parents 5104c30 + c103d2b commit 47bd5b7
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
13 changes: 13 additions & 0 deletions cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package cli

import (
extCmd "dredger/cmd"
"dredger/core"
gen "dredger/generator"
"errors"
"os"
Expand All @@ -26,6 +27,15 @@ var rootCmd = &cobra.Command{
Long: "Generate Go-Server code and RapidDoc-Clientcode for your application by providing an OpenAPI Specification",
}

var showVersion = &cobra.Command{
Use: "version",
Short: "Show the version of the dredger tool",
Args: cobra.ExactArgs(0),
Run: func(cmd *cobra.Command, args []string) {
println("dredger v" + core.Version)
},
}

var generateBdd = &cobra.Command{
Use: "generate-bdd <path to feature file>",
Short: "Create BDD test file from the feature file",
Expand Down Expand Up @@ -119,4 +129,7 @@ func init() {

//add bdd command
rootCmd.AddCommand(generateBdd)

// add version command
rootCmd.AddCommand(showVersion)
}
13 changes: 13 additions & 0 deletions core/core.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package core

import (
_ "embed"
"strings"
)

var (
// Version labels the release
Version string = strings.TrimSpace(version)
//go:embed version
version string
)
2 changes: 1 addition & 1 deletion core/version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.21
0.2.22

0 comments on commit 47bd5b7

Please sign in to comment.