@@ -21,7 +21,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
2121
2222 globalCmd .Command ("list" , "List global hooks." ).
2323 Action (func (_ * kingpin.ParseContext ) error {
24- dump , err := globalRequest (sh_debug .DefaultClient ()).List (outputFormat )
24+ client , err := sh_debug .DefaultClient ()
25+ if err != nil {
26+ return err
27+ }
28+ dump , err := globalRequest (client ).List (outputFormat )
2529 if err != nil {
2630 return err
2731 }
@@ -31,7 +35,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
3135
3236 globalCmd .Command ("values" , "Dump current global values." ).
3337 Action (func (_ * kingpin.ParseContext ) error {
34- dump , err := globalRequest (sh_debug .DefaultClient ()).Values (outputFormat )
38+ client , err := sh_debug .DefaultClient ()
39+ if err != nil {
40+ return err
41+ }
42+ dump , err := globalRequest (client ).Values (outputFormat )
3543 if err != nil {
3644 return err
3745 }
@@ -41,7 +49,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
4149
4250 globalCmd .Command ("config" , "Dump global config values." ).
4351 Action (func (_ * kingpin.ParseContext ) error {
44- dump , err := globalRequest (sh_debug .DefaultClient ()).Config (outputFormat )
52+ client , err := sh_debug .DefaultClient ()
53+ if err != nil {
54+ return err
55+ }
56+ dump , err := globalRequest (client ).Config (outputFormat )
4557 if err != nil {
4658 return err
4759 }
@@ -51,7 +63,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
5163
5264 globalCmd .Command ("patches" , "Dump global value patches." ).
5365 Action (func (_ * kingpin.ParseContext ) error {
54- dump , err := globalRequest (sh_debug .DefaultClient ()).Patches ()
66+ client , err := sh_debug .DefaultClient ()
67+ if err != nil {
68+ return err
69+ }
70+ dump , err := globalRequest (client ).Patches ()
5571 if err != nil {
5672 return err
5773 }
@@ -61,7 +77,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
6177
6278 globalCmd .Command ("snapshots" , "Dump snapshots for all global hooks." ).
6379 Action (func (_ * kingpin.ParseContext ) error {
64- out , err := globalRequest (sh_debug .DefaultClient ()).Snapshots (outputFormat )
80+ client , err := sh_debug .DefaultClient ()
81+ if err != nil {
82+ return err
83+ }
84+ out , err := globalRequest (client ).Snapshots (outputFormat )
6585 if err != nil {
6686 return err
6787 }
@@ -77,7 +97,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
7797
7898 moduleCmd .Command ("list" , "List available modules and their enabled status." ).
7999 Action (func (_ * kingpin.ParseContext ) error {
80- modules , err := moduleRequest (sh_debug .DefaultClient ()).List (outputFormat )
100+ client , err := sh_debug .DefaultClient ()
101+ if err != nil {
102+ return err
103+ }
104+ modules , err := moduleRequest (client ).List (outputFormat )
81105 if err != nil {
82106 return err
83107 }
@@ -92,7 +116,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
92116
93117 moduleValuesCmd := moduleCmd .Command ("values" , "Dump module values by name." ).
94118 Action (func (_ * kingpin.ParseContext ) error {
95- dump , err := moduleRequest (sh_debug .DefaultClient ()).Name (moduleName ).Values (outputFormat , showGlobal )
119+ client , err := sh_debug .DefaultClient ()
120+ if err != nil {
121+ return err
122+ }
123+ dump , err := moduleRequest (client ).Name (moduleName ).Values (outputFormat , showGlobal )
96124 if err != nil {
97125 return err
98126 }
@@ -109,7 +137,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
109137
110138 moduleRenderCmd := moduleCmd .Command ("render" , "Render module manifests." ).
111139 Action (func (_ * kingpin.ParseContext ) error {
112- dump , err := moduleRequest (sh_debug .DefaultClient ()).Name (moduleName ).Render (debug , diff )
140+ client , err := sh_debug .DefaultClient ()
141+ if err != nil {
142+ return err
143+ }
144+ dump , err := moduleRequest (client ).Name (moduleName ).Render (debug , diff )
113145 if err != nil {
114146 return err
115147 }
@@ -122,7 +154,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
122154
123155 moduleConfigCmd := moduleCmd .Command ("config" , "Dump module config values by name." ).
124156 Action (func (_ * kingpin.ParseContext ) error {
125- dump , err := moduleRequest (sh_debug .DefaultClient ()).Name (moduleName ).Config (outputFormat , showGlobal )
157+ client , err := sh_debug .DefaultClient ()
158+ if err != nil {
159+ return err
160+ }
161+ dump , err := moduleRequest (client ).Config (outputFormat , showGlobal )
126162 if err != nil {
127163 return err
128164 }
@@ -134,7 +170,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
134170
135171 modulePatchesCmd := moduleCmd .Command ("patches" , "Dump module value patches by name." ).
136172 Action (func (_ * kingpin.ParseContext ) error {
137- dump , err := moduleRequest (sh_debug .DefaultClient ()).Name (moduleName ).Patches ()
173+ client , err := sh_debug .DefaultClient ()
174+ if err != nil {
175+ return err
176+ }
177+ dump , err := moduleRequest (client ).Name (moduleName ).Patches ()
138178 if err != nil {
139179 return err
140180 }
@@ -145,7 +185,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
145185
146186 moduleResourceMonitorCmd := moduleCmd .Command ("resource-monitor" , "Dump resource monitors." ).
147187 Action (func (_ * kingpin.ParseContext ) error {
148- out , err := moduleRequest (sh_debug .DefaultClient ()).Name (moduleName ).ResourceMonitor (outputFormat )
188+ client , err := sh_debug .DefaultClient ()
189+ if err != nil {
190+ return err
191+ }
192+ out , err := moduleRequest (client ).Name (moduleName ).ResourceMonitor (outputFormat )
149193 if err != nil {
150194 return err
151195 }
@@ -156,7 +200,11 @@ func DefineDebugCommands(kpApp *kingpin.Application) {
156200
157201 moduleSnapshotsCmd := moduleCmd .Command ("snapshots" , "Dump snapshots for all hooks." ).
158202 Action (func (_ * kingpin.ParseContext ) error {
159- out , err := moduleRequest (sh_debug .DefaultClient ()).Name (moduleName ).Snapshots (outputFormat )
203+ client , err := sh_debug .DefaultClient ()
204+ if err != nil {
205+ return err
206+ }
207+ out , err := moduleRequest (client ).Name (moduleName ).Snapshots (outputFormat )
160208 if err != nil {
161209 return err
162210 }
0 commit comments