MCPcopy Create free account
hub / github.com/devnullvoid/pvetui / runCommunityScriptsShow

Function runCommunityScriptsShow

internal/cli/community_scripts.go:189–213  ·  view source on GitHub ↗
(cmd *cobra.Command, args []string)

Source from the content-addressed store, hash-verified

187}
188
189func runCommunityScriptsShow(cmd *cobra.Command, args []string) error {
190 session, err := initCLISession(cmd)
191 if err != nil {
192 return printError(err)
193 }
194 if session == nil {
195 return nil
196 }
197 if err := ensureCommunityScriptsEnabled(session); err != nil {
198 return printError(err)
199 }
200
201 script, err := findCommunityScript(args[0])
202 if err != nil {
203 return printError(err)
204 }
205
206 out := communityScriptToOutput(script)
207 if getOutputFormat(cmd) == outputTable {
208 printCommunityScriptDetailsTable(out)
209 return nil
210 }
211
212 return printJSON(out)
213}
214
215func runCommunityScriptsPlan(cmd *cobra.Command, args []string) error {
216 plan, err := buildCommunityScriptPlan(cmd, args[0])

Callers

nothing calls this directly

Calls 8

initCLISessionFunction · 0.85
printErrorFunction · 0.85
findCommunityScriptFunction · 0.85
communityScriptToOutputFunction · 0.85
getOutputFormatFunction · 0.85
printJSONFunction · 0.85

Tested by

no test coverage detected