deduplicate termstatus setup

This commit is contained in:
Michael Eischer committed 2025-10-03 18:55:46 +02:00
1 parent 1ae2d08d1b
commit 3410808dcf
68 files changed
+335 -450

No files matched your search

+2 -4
View File
@@ -7,7 +7,7 @@ import (
"github.com/spf13/cobra"
)
func newVersionCommand() *cobra.Command {
func newVersionCommand(globalOptions *GlobalOptions) *cobra.Command {
cmd := &cobra.Command{
Use: "version",
Short: "Print version information",
@@ -23,9 +23,7 @@ Exit status is 1 if there was any error.
`,
DisableAutoGenTag: true,
Run: func(_ *cobra.Command, _ []string) {
term, cancel := setupTermstatus()
defer cancel()
printer := newTerminalProgressPrinter(globalOptions.JSON, globalOptions.verbosity, term)
printer := newTerminalProgressPrinter(globalOptions.JSON, globalOptions.verbosity, globalOptions.term)
if globalOptions.JSON {
type jsonVersion struct {