This is an automated email from the ASF dual-hosted git repository.

zhongxjian pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/dubbo-kubernetes.git


The following commit(s) were added to refs/heads/master by this push:
     new 4c856c09 [operator] update command logic
4c856c09 is described below

commit 4c856c09feefce51de20dbae715560504293b93d
Author: mfordjody <[email protected]>
AuthorDate: Thu Dec 26 14:52:54 2024 +0800

    [operator] update command logic
---
 dubboctl/cmd/root.go   | 9 ++++-----
 pkg/version/cobra.go   | 3 +++
 pkg/version/version.go | 4 ++++
 3 files changed, 11 insertions(+), 5 deletions(-)

diff --git a/dubboctl/cmd/root.go b/dubboctl/cmd/root.go
index 18b40e1a..c333553f 100644
--- a/dubboctl/cmd/root.go
+++ b/dubboctl/cmd/root.go
@@ -30,11 +30,10 @@ func AddFlags(cmd *cobra.Command) {
 
 func GetRootCmd(args []string) *cobra.Command {
        rootCmd := &cobra.Command{
-               Use:           "dubboctl",
-               Short:         "Dubbo command line utilities",
-               SilenceUsage:  true,
-               SilenceErrors: true,
-               Long:          `Dubbo configuration command line utility for 
debug and use dubbo applications.`,
+               Use:          "dubboctl",
+               Short:        "Dubbo command line utilities",
+               SilenceUsage: true,
+               Long:         `Dubbo configuration command line utility for 
debug and use dubbo applications.`,
        }
        AddFlags(rootCmd)
        rootCmd.SetArgs(args)
diff --git a/pkg/version/cobra.go b/pkg/version/cobra.go
index b2995715..8e7e36aa 100644
--- a/pkg/version/cobra.go
+++ b/pkg/version/cobra.go
@@ -35,6 +35,9 @@ func CobraCommandWithOptions() *cobra.Command {
                        case "":
                                if short {
                                        _, _ = fmt.Fprintf(cmd.OutOrStdout(), 
"client version: %s\n", version.ClientVersion.Version)
+
+                               } else {
+                                       _, _ = fmt.Fprintf(cmd.OutOrStdout(), 
"client version: %s\n", version.ClientVersion.LongForm())
                                }
                        case "yaml":
                                if marshaled, err := yaml.Marshal(&version); 
err == nil {
diff --git a/pkg/version/version.go b/pkg/version/version.go
index 636fea39..86ee724b 100644
--- a/pkg/version/version.go
+++ b/pkg/version/version.go
@@ -31,6 +31,10 @@ func (b BuildInfo) String() string {
        return fmt.Sprintf("%v-%v-%v", b.Version)
 }
 
+func (b BuildInfo) LongForm() string {
+       return fmt.Sprintf("%#v", b)
+}
+
 func init() {
        Info = BuildInfo{
                Version: buildVersion,

Reply via email to