Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set version command output to Stdout #1869

Merged
merged 3 commits into from Mar 24, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions pkg/commands/version.go
Expand Up @@ -2,6 +2,7 @@ package commands

import (
"encoding/json"
"os"
"strings"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -33,6 +34,7 @@ func (e *Executor) initVersion() {
Use: "version",
Short: "Version",
RunE: func(cmd *cobra.Command, _ []string) error {
cmd.SetOut(os.Stdout)
ldez marked this conversation as resolved.
Show resolved Hide resolved
switch strings.ToLower(e.cfg.Version.Format) {
case "short":
cmd.Println(e.version)
Expand Down