You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by nf...@apache.org on 2020/04/09 11:35:50 UTC
[camel-k] branch master updated: chore(util): allow to build
different CLI variants at build time
This is an automated email from the ASF dual-hosted git repository.
nferraro pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel-k.git
The following commit(s) were added to refs/heads/master by this push:
new 777f31f chore(util): allow to build different CLI variants at build time
777f31f is described below
commit 777f31fc7bed50260f65ac82fa458d488c5ab324
Author: Nicola Ferraro <ni...@gmail.com>
AuthorDate: Thu Apr 9 13:35:08 2020 +0200
chore(util): allow to build different CLI variants at build time
---
pkg/cmd/version.go | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/pkg/cmd/version.go b/pkg/cmd/version.go
index c5bcaf6..1097eed 100644
--- a/pkg/cmd/version.go
+++ b/pkg/cmd/version.go
@@ -25,13 +25,20 @@ import (
"github.com/spf13/cobra"
)
+// VersionVariant may be overridden at build time
+var VersionVariant = ""
+
func newCmdVersion() *cobra.Command {
return &cobra.Command{
Use: "version",
Short: "Display client version",
Long: `Display Camel K client version.`,
Run: func(_ *cobra.Command, _ []string) {
- fmt.Println("Camel K Client " + defaults.Version)
+ if VersionVariant != "" {
+ fmt.Printf("Camel K Client %s %s\n", VersionVariant, defaults.Version)
+ } else {
+ fmt.Printf("Camel K Client %s\n", defaults.Version)
+ }
},
Annotations: map[string]string{
offlineCommandLabel: "true",