Skip to content

Commit 0de6bf1

Browse files
author
Yago Carlos Fernandez Gou
committed
use new DebugInputModel function
1 parent 3717766 commit 0de6bf1

File tree

5 files changed

+5
-40
lines changed

5 files changed

+5
-40
lines changed

internal/cmd/beta/intake/runner/create/create.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) {
120120
Labels: flags.FlagToStringToStringPointer(p, cmd, labelFlag),
121121
}
122122

123-
if p.IsVerbosityDebug() {
124-
modelStr, err := print.BuildDebugStrFromInputModel(model)
125-
if err != nil {
126-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
127-
} else {
128-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
129-
}
130-
}
123+
p.DebugInputModel(model)
131124

132125
return &model, nil
133126
}

internal/cmd/beta/intake/runner/delete/delete.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -86,14 +86,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
8686
RunnerId: runnerId,
8787
}
8888

89-
if p.IsVerbosityDebug() {
90-
modelStr, err := print.BuildDebugStrFromInputModel(model)
91-
if err != nil {
92-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
93-
} else {
94-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
95-
}
96-
}
89+
p.DebugInputModel(model)
9790

9891
return &model, nil
9992
}

internal/cmd/beta/intake/runner/describe/describe.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
8282
RunnerId: runnerId,
8383
}
8484

85-
if p.IsVerbosityDebug() {
86-
modelStr, err := print.BuildDebugStrFromInputModel(model)
87-
if err != nil {
88-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
89-
} else {
90-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
91-
}
92-
}
85+
p.DebugInputModel(model)
9386

9487
return &model, nil
9588
}

internal/cmd/beta/intake/runner/list/list.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -114,14 +114,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command) (*inputModel, error) {
114114
Limit: limit,
115115
}
116116

117-
if p.IsVerbosityDebug() {
118-
modelStr, err := print.BuildDebugStrFromInputModel(model)
119-
if err != nil {
120-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
121-
} else {
122-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
123-
}
124-
}
117+
p.DebugInputModel(model)
125118

126119
return &model, nil
127120
}

internal/cmd/beta/intake/runner/update/update.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,7 @@ func parseInput(p *print.Printer, cmd *cobra.Command, inputArgs []string) (*inpu
120120
return nil, &cliErr.EmptyUpdateError{}
121121
}
122122

123-
if p.IsVerbosityDebug() {
124-
modelStr, err := print.BuildDebugStrFromInputModel(model)
125-
if err != nil {
126-
p.Debug(print.ErrorLevel, "convert model to string for debugging: %v", err)
127-
} else {
128-
p.Debug(print.DebugLevel, "parsed input values: %s", modelStr)
129-
}
130-
}
123+
p.DebugInputModel(model)
131124

132125
return &model, nil
133126
}

0 commit comments

Comments
 (0)