mirror of
https://github.com/restic/restic.git
synced 2026-11-23 13:52:39 +00:00
deduplicate termstatus setup
This commit is contained in:
1 parent
1ae2d08d1b
commit
3410808dcf
68 files changed
+335
-450
No files matched your search
@@ -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 {
|
||||
|
||||
Reference in new issue
Block a user